summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
diff options
context:
space:
mode:
authorKui-Feng Lee <thinker.li@gmail.com>2024-02-04 09:12:04 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2024-02-05 21:52:38 +0300
commit169e650069647325496e5a65408ff301874c8e01 (patch)
tree1ccdd32f79d639cd3cdf9b86c50debd1a864df24 /tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
parent7e428638bd784fd9e8944bfbf11513520e141b91 (diff)
downloadlinux-169e650069647325496e5a65408ff301874c8e01.tar.xz
selftests/bpf: Suppress warning message of an unused variable.
"r" is used to receive the return value of test_2 in bpf_testmod.c, but it is not actually used. So, we remove "r" and change the return type to "void". Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202401300557.z5vzn8FM-lkp@intel.com/ Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/r/20240204061204.1864529-1-thinker.li@gmail.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c')
-rw-r--r--tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
index 4754c662b39f..a06daebc75c9 100644
--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
@@ -554,9 +554,8 @@ static const struct bpf_verifier_ops bpf_testmod_verifier_ops = {
static int bpf_dummy_reg(void *kdata)
{
struct bpf_testmod_ops *ops = kdata;
- int r;
- r = ops->test_2(4, 3);
+ ops->test_2(4, 3);
return 0;
}
@@ -570,9 +569,8 @@ static int bpf_testmod_test_1(void)
return 0;
}
-static int bpf_testmod_test_2(int a, int b)
+static void bpf_testmod_test_2(int a, int b)
{
- return 0;
}
static struct bpf_testmod_ops __bpf_testmod_ops = {