LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] smp: Use str_plural() to fix Coccinelle warnings
@ 2024-03-27 22:42 Thorsten Blum
  2024-04-01 14:31 ` [PATCH v2] " Thorsten Blum
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Blum @ 2024-03-27 22:42 UTC (permalink / raw
  To: Peter Zijlstra (Intel), Leonardo Bras, Imran Khan,
	Paul E. McKenney, Rik van Riel, Thomas Gleixner
  Cc: linux-kernel, Thorsten Blum

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] smp: Use str_plural() to fix Coccinelle warnings
  2024-03-27 22:42 [PATCH] smp: Use str_plural() to fix Coccinelle warnings Thorsten Blum
@ 2024-04-01 14:31 ` Thorsten Blum
  2024-04-01 20:56   ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Blum @ 2024-04-01 14:31 UTC (permalink / raw
  To: thorsten.blum
  Cc: imran.f.khan, leobras, linux-kernel, paulmck, peterz, riel, tglx

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>
---
Changes in v2:
- Include missing header file
---
 kernel/smp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index f085ebcdf9e7..28fee28174e0 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -25,6 +25,7 @@
 #include <linux/nmi.h>
 #include <linux/sched/debug.h>
 #include <linux/jump_label.h>
+#include <linux/string_choices.h>
 
 #include <trace/events/ipi.h>
 #define CREATE_TRACE_POINTS
@@ -982,8 +983,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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] smp: Use str_plural() to fix Coccinelle warnings
  2024-04-01 14:31 ` [PATCH v2] " Thorsten Blum
@ 2024-04-01 20:56   ` Paul E. McKenney
  2024-05-08 15:42     ` [RESEND PATCH " Thorsten Blum
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2024-04-01 20:56 UTC (permalink / raw
  To: Thorsten Blum; +Cc: imran.f.khan, leobras, linux-kernel, peterz, riel, tglx

On Mon, Apr 01, 2024 at 04:31:18PM +0200, Thorsten Blum wrote:
> 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>

Acked-by: Paul E. McKenney <paulmck@kernel.org>

> ---
> Changes in v2:
> - Include missing header file
> ---
>  kernel/smp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/smp.c b/kernel/smp.c
> index f085ebcdf9e7..28fee28174e0 100644
> --- a/kernel/smp.c
> +++ b/kernel/smp.c
> @@ -25,6 +25,7 @@
>  #include <linux/nmi.h>
>  #include <linux/sched/debug.h>
>  #include <linux/jump_label.h>
> +#include <linux/string_choices.h>
>  
>  #include <trace/events/ipi.h>
>  #define CREATE_TRACE_POINTS
> @@ -982,8 +983,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
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RESEND PATCH v2] smp: Use str_plural() to fix Coccinelle warnings
  2024-04-01 20:56   ` Paul E. McKenney
@ 2024-05-08 15:42     ` Thorsten Blum
  2024-06-17 13:27       ` [tip: smp/core] " tip-bot2 for Thorsten Blum
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Blum @ 2024-05-08 15:42 UTC (permalink / raw
  To: paulmck
  Cc: imran.f.khan, leobras, linux-kernel, peterz, riel, tglx,
	thorsten.blum

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>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
---
Changes in v2:
- Include missing header file
---
 kernel/smp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index f085ebcdf9e7..28fee28174e0 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -25,6 +25,7 @@
 #include <linux/nmi.h>
 #include <linux/sched/debug.h>
 #include <linux/jump_label.h>
+#include <linux/string_choices.h>
 
 #include <trace/events/ipi.h>
 #define CREATE_TRACE_POINTS
@@ -982,8 +983,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.45.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [tip: smp/core] smp: Use str_plural() to fix Coccinelle warnings
  2024-05-08 15:42     ` [RESEND PATCH " Thorsten Blum
@ 2024-06-17 13:27       ` tip-bot2 for Thorsten Blum
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Thorsten Blum @ 2024-06-17 13:27 UTC (permalink / raw
  To: linux-tip-commits
  Cc: Thorsten Blum, Thomas Gleixner, Paul E. McKenney, x86,
	linux-kernel

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     c4df15931cb72556fea93bd763ada88e56cbd8e5
Gitweb:        https://git.kernel.org/tip/c4df15931cb72556fea93bd763ada88e56cbd8e5
Author:        Thorsten Blum <thorsten.blum@toblux.com>
AuthorDate:    Wed, 08 May 2024 17:42:26 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 17 Jun 2024 15:17:44 +02:00

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 <thorsten.blum@toblux.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/r/20240508154225.309703-2-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 f085ebc..1848357 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -25,6 +25,7 @@
 #include <linux/nmi.h>
 #include <linux/sched/debug.h>
 #include <linux/jump_label.h>
+#include <linux/string_choices.h>
 
 #include <trace/events/ipi.h>
 #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);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-06-17 13:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 22:42 [PATCH] smp: Use str_plural() to fix Coccinelle warnings Thorsten Blum
2024-04-01 14:31 ` [PATCH v2] " Thorsten Blum
2024-04-01 20:56   ` Paul E. McKenney
2024-05-08 15:42     ` [RESEND PATCH " Thorsten Blum
2024-06-17 13:27       ` [tip: smp/core] " tip-bot2 for Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).