Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Guo Zhengkui and committed by
David S. Miller
0273d101 0c1794c2

+1 -1
+1 -1
tools/testing/selftests/net/reuseport_bpf_numa.c
··· 86 86 87 87 memset(&attr, 0, sizeof(attr)); 88 88 attr.prog_type = BPF_PROG_TYPE_SOCKET_FILTER; 89 - attr.insn_cnt = sizeof(prog) / sizeof(prog[0]); 89 + attr.insn_cnt = ARRAY_SIZE(prog); 90 90 attr.insns = (unsigned long) &prog; 91 91 attr.license = (unsigned long) &bpf_license; 92 92 attr.log_buf = (unsigned long) &bpf_log_buf;