]>
Commit | Line | Data |
---|---|---|
49505f6f JB |
1 | From f516acd5397fdbb77ef0aad0798d9ef7c3001d72 Mon Sep 17 00:00:00 2001 |
2 | From: Ian Rogers <irogers@google.com> | |
3 | Date: Fri, 15 May 2020 09:50:02 -0700 | |
4 | Subject: libbpf, hashmap: Remove unused #include | |
5 | ||
6 | Remove #include of libbpf_internal.h that is unused. | |
7 | ||
8 | Discussed in this thread: | |
9 | https://lore.kernel.org/lkml/CAEf4BzZRmiEds_8R8g4vaAeWvJzPb4xYLnpF0X2VNY8oTzkphQ@mail.gmail.com/ | |
10 | ||
11 | Signed-off-by: Ian Rogers <irogers@google.com> | |
12 | Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> | |
13 | Acked-by: Andrii Nakryiko <andriin@fb.com> | |
14 | Link: https://lore.kernel.org/bpf/20200515165007.217120-3-irogers@google.com | |
15 | --- | |
16 | tools/lib/bpf/hashmap.h | 1 - | |
17 | 1 file changed, 1 deletion(-) | |
18 | ||
19 | (limited to 'tools/lib/bpf/hashmap.h') | |
20 | ||
21 | diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h | |
22 | index bae8879cdf58..e823b35e7371 100644 | |
23 | --- a/tools/lib/bpf/hashmap.h | |
24 | +++ b/tools/lib/bpf/hashmap.h | |
25 | @@ -15,7 +15,6 @@ | |
26 | #else | |
27 | #include <bits/reg.h> | |
28 | #endif | |
29 | -#include "libbpf_internal.h" | |
30 | ||
31 | static inline size_t hash_bits(size_t h, int bits) | |
32 | { | |
33 | -- | |
34 | cgit 1.2.3-1.el7 | |
35 | ||
36 | From 8ca8d4a841730c02e77bf3c87bf658cc44f364b9 Mon Sep 17 00:00:00 2001 | |
37 | From: Arnaldo Carvalho de Melo <acme@kernel.org> | |
38 | Date: Tue, 9 Jun 2020 18:16:53 -0300 | |
39 | Subject: libbpf: Define __WORDSIZE if not available | |
40 | ||
41 | Some systems, such as Android, don't have a define for __WORDSIZE, do it | |
42 | in terms of __SIZEOF_LONG__, as done in perf since 2012: | |
43 | ||
44 | http://git.kernel.org/torvalds/c/3f34f6c0233ae055b5 | |
45 | ||
46 | For reference: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html | |
47 | ||
48 | I build tested it here and Andrii did some Travis CI build tests too. | |
49 | ||
50 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> | |
51 | Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> | |
52 | Acked-by: Andrii Nakryiko <andriin@fb.com> | |
53 | Link: https://lore.kernel.org/bpf/20200608161150.GA3073@kernel.org | |
54 | --- | |
55 | tools/lib/bpf/hashmap.h | 7 +++---- | |
56 | 1 file changed, 3 insertions(+), 4 deletions(-) | |
57 | ||
58 | (limited to 'tools/lib/bpf/hashmap.h') | |
59 | ||
60 | diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h | |
61 | index e823b35e7371..df59fd4fc95b 100644 | |
62 | --- a/tools/lib/bpf/hashmap.h | |
63 | +++ b/tools/lib/bpf/hashmap.h | |
64 | @@ -10,10 +10,9 @@ | |
65 | ||
66 | #include <stdbool.h> | |
67 | #include <stddef.h> | |
68 | -#ifdef __GLIBC__ | |
69 | -#include <bits/wordsize.h> | |
70 | -#else | |
71 | -#include <bits/reg.h> | |
72 | +#include <limits.h> | |
73 | +#ifndef __WORDSIZE | |
74 | +#define __WORDSIZE (__SIZEOF_LONG__ * 8) | |
75 | #endif | |
76 | ||
77 | static inline size_t hash_bits(size_t h, int bits) | |
78 | -- | |
79 | cgit 1.2.3-1.el7 | |
80 |