From: Thorsten Blum Date: Wed, 8 May 2024 15:42:26 +0000 (+0200) Subject: smp: Use str_plural() to fix Coccinelle warnings X-Git-Tag: v6.11-rc1~229^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4df15931cb72556fea93bd763ada88e56cbd8e5;p=thirdparty%2Flinux.git 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 Signed-off-by: Thomas Gleixner Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20240508154225.309703-2-thorsten.blum@toblux.com --- diff --git a/kernel/smp.c b/kernel/smp.c index f085ebcdf9e70..18483570cc5f4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #define CREATE_TRACE_POINTS @@ -982,8 +983,7 @@ void __init smp_init(void) num_nodes = num_online_nodes(); num_cpus = num_online_cpus(); pr_info("Brought up %d node%s, %d CPU%s\n", - num_nodes, (num_nodes > 1 ? "s" : ""), - num_cpus, (num_cpus > 1 ? "s" : "")); + num_nodes, str_plural(num_nodes), num_cpus, str_plural(num_cpus)); /* Any cleanup work */ smp_cpus_done(setup_max_cpus);