libbpf/backport-libbpf-Avoid-unused-function-warning-on-bpf_tail_call_static.patch
zhang-mingyi66 41482aa641 backporting
2023-01-29 14:58:03 +08:00

31 lines
1.1 KiB
Diff

From f15814c93ade62519c9ccb50a8ca5c8998010ac2 Mon Sep 17 00:00:00 2001
From: Ian Rogers <irogers@google.com>
Date: Wed, 13 Jan 2021 14:36:08 -0800
Subject: [PATCH] bpf, libbpf: Avoid unused function warning on
bpf_tail_call_static
Add inline to __always_inline making it match the linux/compiler.h.
Adding this avoids an unused function warning on bpf_tail_call_static
when compining with -Wall.
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210113223609.3358812-1-irogers@google.com
---
src/bpf_helpers.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bpf_helpers.h b/src/bpf_helpers.h
index 72b25111..ae6c975e 100644
--- a/src/bpf_helpers.h
+++ b/src/bpf_helpers.h
@@ -30,7 +30,7 @@
#define SEC(NAME) __attribute__((section(NAME), used))
#ifndef __always_inline
-#define __always_inline __attribute__((always_inline))
+#define __always_inline inline __attribute__((always_inline))
#endif
#ifndef __noinline
#define __noinline __attribute__((noinline))