[PATCH] powerpc: Use str_plural() to fix Coccinelle warning

Thorsten Blum posted 1 patch 1 year, 10 months ago
arch/powerpc/kernel/setup-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] powerpc: Use str_plural() to fix Coccinelle warning
Posted by Thorsten Blum 1 year, 10 months ago
Fixes the following Coccinelle/coccicheck warning reported by
string_choices.cocci:

	opportunity for str_plural(tpc)

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
 arch/powerpc/kernel/setup-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 01ed1263e1a9..4bd2f87616ba 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -405,7 +405,7 @@ static void __init cpu_init_thread_core_maps(int tpc)
 		cpumask_set_cpu(i, &threads_core_mask);
 
 	printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n",
-	       tpc, tpc > 1 ? "s" : "");
+	       tpc, str_plural(tpc));
 	printk(KERN_DEBUG " (thread shift is %d)\n", threads_shift);
 }
 
-- 
2.44.0
Re: [PATCH] powerpc: Use str_plural() to fix Coccinelle warning
Posted by Michael Ellerman 1 year, 9 months ago
On Mon, 01 Apr 2024 00:22:50 +0200, Thorsten Blum wrote:
> Fixes the following Coccinelle/coccicheck warning reported by
> string_choices.cocci:
> 
> 	opportunity for str_plural(tpc)
> 
> 

Applied to powerpc/next.

[1/1] powerpc: Use str_plural() to fix Coccinelle warning
      https://git.kernel.org/powerpc/c/3e42e72796d8991fecad78d61a180e24a4853427

cheers