summaryrefslogtreecommitdiff
path: root/net/bpf
diff options
context:
space:
mode:
authorJean-Philippe Menil <jpmenil@gmail.com>2020-03-27 23:47:13 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2020-03-28 20:13:18 +0300
commite9ff9d52540a53ce8c9eff5bf8b66467fe81eb2b (patch)
tree4d1180ad9c48217810d79502e5563101c3c27530 /net/bpf
parent291cfe365bd3d5002a9c49e9fca8f30136eebc28 (diff)
downloadlinux-e9ff9d52540a53ce8c9eff5bf8b66467fe81eb2b.tar.xz
bpf: Fix build warning regarding missing prototypes
Fix build warnings when building net/bpf/test_run.o with W=1 due to missing prototype for bpf_fentry_test{1..6}. Instead of declaring prototypes, turn off warnings with __diag_{push,ignore,pop} as pointed out by Alexei. Signed-off-by: Jean-Philippe Menil <jpmenil@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20200327204713.28050-1-jpmenil@gmail.com
Diffstat (limited to 'net/bpf')
-rw-r--r--net/bpf/test_run.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 4c921f5154e0..29dbdd4c29f6 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -114,6 +114,9 @@ out:
* architecture dependent calling conventions. 7+ can be supported in the
* future.
*/
+__diag_push();
+__diag_ignore(GCC, 8, "-Wmissing-prototypes",
+ "Global functions as their definitions will be in vmlinux BTF");
int noinline bpf_fentry_test1(int a)
{
return a + 1;
@@ -149,6 +152,7 @@ int noinline bpf_modify_return_test(int a, int *b)
*b += 1;
return a + *b;
}
+__diag_pop();
ALLOW_ERROR_INJECTION(bpf_modify_return_test, ERRNO);