aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf_common.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2021-11-03 22:08:34 +0000
committerAlexei Starovoitov <[email protected]>2021-11-07 16:34:22 +0000
commitbe80e9cdbca8ac66d09e0e24e0bd41d992362a0b (patch)
treef921e47f574fb5d37ef23addc687343887eb90e0 /tools/lib/bpf/libbpf_common.h
parentlibbpf: Fix non-C89 loop variable declaration in gen_loader.c (diff)
downloadkernel-be80e9cdbca8ac66d09e0e24e0bd41d992362a0b.tar.gz
kernel-be80e9cdbca8ac66d09e0e24e0bd41d992362a0b.zip
libbpf: Rename DECLARE_LIBBPF_OPTS into LIBBPF_OPTS
It's confusing that libbpf-provided helper macro doesn't start with LIBBPF. Also "declare" vs "define" is confusing terminology, I can never remember and always have to look up previous examples. Bypass both issues by renaming DECLARE_LIBBPF_OPTS into a short and clean LIBBPF_OPTS. To avoid breaking existing code, provide: #define DECLARE_LIBBPF_OPTS LIBBPF_OPTS in libbpf_legacy.h. We can decide later if we ever want to remove it or we'll keep it forever because it doesn't add any maintainability burden. Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Dave Marchevsky <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf_common.h')
-rw-r--r--tools/lib/bpf/libbpf_common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf_common.h b/tools/lib/bpf/libbpf_common.h
index aaa1efbf6f51..0967112b933a 100644
--- a/tools/lib/bpf/libbpf_common.h
+++ b/tools/lib/bpf/libbpf_common.h
@@ -54,7 +54,7 @@
* including any extra padding, it with memset() and then assigns initial
* values provided by users in struct initializer-syntax as varargs.
*/
-#define DECLARE_LIBBPF_OPTS(TYPE, NAME, ...) \
+#define LIBBPF_OPTS(TYPE, NAME, ...) \
struct TYPE NAME = ({ \
memset(&NAME, 0, sizeof(struct TYPE)); \
(struct TYPE) { \