[PATCH] perf tests: fix array_size.cocci warning

From: Guo Zhengkui
Date: Mon Nov 08 2021 - 02:08:44 EST


Fix following coccicheck warnings:
./tools/perf/tests/bpf.c:316:22-23: WARNING: Use ARRAY_SIZE.

Signed-off-by: Guo Zhengkui <guozhengkui@xxxxxxxx>
---
tools/perf/tests/bpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 2bf146e49ce8..369e963eeec1 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -313,7 +313,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",
--
2.20.1