Skip to contentSkip to conversation

m68k: amiga: Use str_plural() to fix Coccinelle warning

PATCH In review Thorsten Blum 2 participants 3 messages Mar 30, 2024 – Apr 29, 2024 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k: amiga: Use str_plural() to fix Coccinelle warning

Fixes the following Coccinelle/coccicheck warning reported by string_choices.cocci:

opportunity for str_plural(zorro_num_autocon)

---
 arch/m68k/amiga/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/amiga/config.c +1 -1
index 99718f3dc686..d4b170c861bf 100644
@@ -836,7 +836,7 @@ static void amiga_get_hardware_list(struct seq_file *m)
 		seq_printf(m, "\tZorro II%s AutoConfig: %d Expansion "
 				"Device%s\n",
 				AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
-				zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
+				zorro_num_autocon, str_plural(zorro_num_autocon));
 #endif /* CONFIG_ZORRO */
 
 #undef AMIGAHW_ANNOUNCE
Signature · 1 line
2.44.0
#1 lore raw

PATCH RESEND 1/1 m68k: amiga: Use str_plural() to fix Coccinelle warning

Fixes the following Coccinelle/coccicheck warning reported by string_choices.cocci:

opportunity for str_plural(zorro_num_autocon)

---
 arch/m68k/amiga/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/amiga/config.c +1 -1
index 99718f3dc686..d4b170c861bf 100644
@@ -836,7 +836,7 @@ static void amiga_get_hardware_list(struct seq_file *m)
 		seq_printf(m, "\tZorro II%s AutoConfig: %d Expansion "
 				"Device%s\n",
 				AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
-				zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
+				zorro_num_autocon, str_plural(zorro_num_autocon));
 #endif /* CONFIG_ZORRO */
 
 #undef AMIGAHW_ANNOUNCE
Signature · 1 line
2.44.0
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Thorsten Blum
Quoted 6 lines · Thorsten Blum

Fixes the following Coccinelle/coccicheck warning reported by string_choices.cocci:

opportunity for str_plural(zorro_num_autocon)

i.e. will queue in the m68k tree for v6.10.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds