Skip to content

Commit c4df159

Browse files
tobluxKAGA-KOKO
authored andcommitted
smp: Use str_plural() to fix Coccinelle warnings
Fixes the following two Coccinelle/coccicheck warnings reported by string_choices.cocci: opportunity for str_plural(num_cpus) opportunity for str_plural(num_nodes) Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f45a605 commit c4df159

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/smp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/nmi.h>
2626
#include <linux/sched/debug.h>
2727
#include <linux/jump_label.h>
28+
#include <linux/string_choices.h>
2829

2930
#include <trace/events/ipi.h>
3031
#define CREATE_TRACE_POINTS
@@ -982,8 +983,7 @@ void __init smp_init(void)
982983
num_nodes = num_online_nodes();
983984
num_cpus = num_online_cpus();
984985
pr_info("Brought up %d node%s, %d CPU%s\n",
985-
num_nodes, (num_nodes > 1 ? "s" : ""),
986-
num_cpus, (num_cpus > 1 ? "s" : ""));
986+
num_nodes, str_plural(num_nodes), num_cpus, str_plural(num_cpus));
987987

988988
/* Any cleanup work */
989989
smp_cpus_done(setup_max_cpus);

0 commit comments

Comments
 (0)