Skip to content

Commit 40fc756

Browse files
Mirsad TodorovacIngo Molnar
authored andcommitted
selftests/x86/syscall: Fix coccinelle WARNING recommending the use of ARRAY_SIZE()
Coccinelle gives WARNING recommending the use of ARRAY_SIZE() macro definition to improve the code readability: ./tools/testing/selftests/x86/syscall_numbering.c:316:35-36: WARNING: Use ARRAY_SIZE Fixes: 15c82d9 ("selftests/x86/syscall: Update and extend syscall_numbering_64") Signed-off-by: Mirsad Todorovac <mtodorovac69@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Link: https://lore.kernel.org/r/20241101111523.1293193-2-mtodorovac69@gmail.com
1 parent e008eee commit 40fc756

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/x86/syscall_numbering.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <sys/mman.h>
2626

2727
#include <linux/ptrace.h>
28+
#include "../kselftest.h"
2829

2930
/* Common system call numbers */
3031
#define SYS_READ 0
@@ -313,7 +314,7 @@ static void test_syscall_numbering(void)
313314
* The MSB is supposed to be ignored, so we loop over a few
314315
* to test that out.
315316
*/
316-
for (size_t i = 0; i < sizeof(msbs)/sizeof(msbs[0]); i++) {
317+
for (size_t i = 0; i < ARRAY_SIZE(msbs); i++) {
317318
int msb = msbs[i];
318319
run("Checking system calls with msb = %d (0x%x)\n",
319320
msb, msb);

0 commit comments

Comments
 (0)