[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240408105515.2328-3-thorsten.blum@toblux.com>
Date: Mon, 8 Apr 2024 12:55:17 +0200
From: Thorsten Blum <thorsten.blum@...lux.com>
To: Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>
Cc: Hendrik Brueckner <brueckner@...ux.ibm.com>,
linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org,
Thorsten Blum <thorsten.blum@...lux.com>
Subject: [PATCH] s390/tools: Use ARRAY_SIZE() to fix Coccinelle warnings
Fixes the following two Coccinelle/coccicheck warnings reported by
array_size.cocci:
WARNING: Use ARRAY_SIZE
WARNING: Use ARRAY_SIZE
Signed-off-by: Thorsten Blum <thorsten.blum@...lux.com>
---
arch/s390/tools/gen_facilities.c | 2 +-
arch/s390/tools/gen_opcode_table.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/s390/tools/gen_facilities.c b/arch/s390/tools/gen_facilities.c
index 68580cbea4e6..ebd8a947e97c 100644
--- a/arch/s390/tools/gen_facilities.c
+++ b/arch/s390/tools/gen_facilities.c
@@ -149,7 +149,7 @@ static void print_facility_lists(void)
{
unsigned int i;
- for (i = 0; i < sizeof(facility_defs) / sizeof(facility_defs[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(facility_defs); i++)
print_facility_list(&facility_defs[i]);
}
diff --git a/arch/s390/tools/gen_opcode_table.c b/arch/s390/tools/gen_opcode_table.c
index a1bc02b29c81..468b70c85f62 100644
--- a/arch/s390/tools/gen_opcode_table.c
+++ b/arch/s390/tools/gen_opcode_table.c
@@ -138,7 +138,7 @@ static struct insn_type *insn_format_to_type(char *format)
strcpy(tmp, format);
base_format = tmp;
base_format = strsep(&base_format, "_");
- for (i = 0; i < sizeof(insn_type_table) / sizeof(insn_type_table[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(insn_type_table); i++) {
ptr = insn_type_table[i].format;
while (*ptr) {
if (!strcmp(base_format, *ptr))
--
2.44.0
Powered by blists - more mailing lists