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
6 Remove #include of libbpf_internal.h that is unused.
8 Discussed in this thread:
9 https://lore.kernel.org/lkml/CAEf4BzZRmiEds_8R8g4vaAeWvJzPb4xYLnpF0X2VNY8oTzkphQ@mail.gmail.com/
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
16 tools/lib/bpf/hashmap.h | 1 -
17 1 file changed, 1 deletion(-)
19 (limited to 'tools/lib/bpf/hashmap.h')
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
29 -#include "libbpf_internal.h"
31 static inline size_t hash_bits(size_t h, int bits)
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
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:
44 http://git.kernel.org/torvalds/c/3f34f6c0233ae055b5
46 For reference: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
48 I build tested it here and Andrii did some Travis CI build tests too.
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
55 tools/lib/bpf/hashmap.h | 7 +++----
56 1 file changed, 3 insertions(+), 4 deletions(-)
58 (limited to 'tools/lib/bpf/hashmap.h')
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
69 -#include <bits/wordsize.h>
71 -#include <bits/reg.h>
74 +#define __WORDSIZE (__SIZEOF_LONG__ * 8)
77 static inline size_t hash_bits(size_t h, int bits)