aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Zhengkui <[email protected]>2021-11-08 15:07:52 +0800
committerArnaldo Carvalho de Melo <[email protected]>2021-11-13 18:11:51 -0300
commitf08a8fccd7eafe06ca48df57bf32cfb753218923 (patch)
treee4e349106a40e2ec67492b5691b68f0586e9d74f
parent27d113cfe892867885ab1d75abe5f42c228ef8a9 (diff)
perf test bpf: Use ARRAY_CHECK() instead of ad-hoc equivalent, addressing array_size.cocci warning
Address following coccicheck warnings: ./tools/perf/tests/bpf.c:316:22-23: WARNING: Use ARRAY_SIZE. Signed-off-by: Guo Zhengkui <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Fastabend <[email protected]> Cc: KP Singh <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Martin KaFai Lau <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Riccardo Mancini <[email protected]> Cc: Song Liu <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Yonghong Song <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/tests/bpf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 2048c9a08e8f..329f77f592f4 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -297,7 +297,7 @@ static int check_env(void)
}
err = bpf_load_program(BPF_PROG_TYPE_KPROBE, insns,
- sizeof(insns) / sizeof(insns[0]),
+ ARRAY_SIZE(insns),
license, kver_int, NULL, 0);
if (err < 0) {
pr_err("Missing basic BPF support, skip this test: %s\n",