summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGuo Zhengkui <guozhengkui@vivo.com>2022-03-06 00:18:35 +0800
committerDavid S. Miller <davem@davemloft.net>2022-03-07 12:23:27 +0000
commit0273d10182ec4507a43b868dd80fd62860b7e948 (patch)
tree63212563e02f633ec6fc9593833a8ee55234fc4e /tools
parent0c1794c200e943ea95a28c0a8c7eda6b5c004a9d (diff)
downloadlinux-0273d10182ec4507a43b868dd80fd62860b7e948.tar.gz
linux-0273d10182ec4507a43b868dd80fd62860b7e948.tar.bz2
linux-0273d10182ec4507a43b868dd80fd62860b7e948.zip
selftests: net: fix array_size.cocci warning
Fit the following coccicheck warning: tools/testing/selftests/net/reuseport_bpf_numa.c:89:28-29: WARNING: Use ARRAY_SIZE. It has been tested with gcc (Debian 8.3.0-6) 8.3.0 on x86_64. Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/net/reuseport_bpf_numa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/reuseport_bpf_numa.c b/tools/testing/selftests/net/reuseport_bpf_numa.c
index b2eebf669b8c..c9ba36aa688e 100644
--- a/tools/testing/selftests/net/reuseport_bpf_numa.c
+++ b/tools/testing/selftests/net/reuseport_bpf_numa.c
@@ -86,7 +86,7 @@ static void attach_bpf(int fd)
memset(&attr, 0, sizeof(attr));
attr.prog_type = BPF_PROG_TYPE_SOCKET_FILTER;
- attr.insn_cnt = sizeof(prog) / sizeof(prog[0]);
+ attr.insn_cnt = ARRAY_SIZE(prog);
attr.insns = (unsigned long) &prog;
attr.license = (unsigned long) &bpf_license;
attr.log_buf = (unsigned long) &bpf_log_buf;