lkml.org 
[lkml]   [2024]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] smp: Use str_plural() to fix Coccinelle warnings
Date
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 <thorsten.blum@toblux.com>
---
kernel/smp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index f085ebcdf9e7..58b7f134c044 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -982,8 +982,8 @@ 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);
--
2.44.0

\
 
 \ /
  Last update: 2024-05-27 16:12    [W:0.074 / U:1.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site