[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <174100267008.10177.10892664815604328750.tip-bot2@tip-bot2>
Date: Mon, 03 Mar 2025 11:51:10 -0000
From: "tip-bot2 for Mirsad Todorovac" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Mirsad Todorovac <mtodorovac69@...il.com>, Ingo Molnar <mingo@...nel.org>,
Muhammad Usama Anjum <usama.anjum@...labora.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/cleanups] selftests/x86/syscall: Fix coccinelle WARNING
recommending the use of ARRAY_SIZE()
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 40fc7561013914ec08c200bb7a0805643a23e070
Gitweb: https://git.kernel.org/tip/40fc7561013914ec08c200bb7a0805643a23e070
Author: Mirsad Todorovac <mtodorovac69@...il.com>
AuthorDate: Fri, 01 Nov 2024 12:15:23 +01:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Mon, 03 Mar 2025 12:38:49 +01:00
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: 15c82d98a0f78 ("selftests/x86/syscall: Update and extend syscall_numbering_64")
Signed-off-by: Mirsad Todorovac <mtodorovac69@...il.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
Link: https://lore.kernel.org/r/20241101111523.1293193-2-mtodorovac69@gmail.com
---
tools/testing/selftests/x86/syscall_numbering.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/x86/syscall_numbering.c b/tools/testing/selftests/x86/syscall_numbering.c
index 9915917..41c42b7 100644
--- a/tools/testing/selftests/x86/syscall_numbering.c
+++ b/tools/testing/selftests/x86/syscall_numbering.c
@@ -25,6 +25,7 @@
#include <sys/mman.h>
#include <linux/ptrace.h>
+#include "../kselftest.h"
/* Common system call numbers */
#define SYS_READ 0
@@ -313,7 +314,7 @@ static void test_syscall_numbering(void)
* The MSB is supposed to be ignored, so we loop over a few
* to test that out.
*/
- for (size_t i = 0; i < sizeof(msbs)/sizeof(msbs[0]); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(msbs); i++) {
int msb = msbs[i];
run("Checking system calls with msb = %d (0x%x)\n",
msb, msb);
Powered by blists - more mailing lists