All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kdb: Use str_plural() to fix Coccinelle warning
@ 2024-03-28 14:00 Thorsten Blum
  2024-03-28 14:31 ` Doug Anderson
  2024-04-26 17:24 ` [PATCH] " Daniel Thompson
  0 siblings, 2 replies; 4+ messages in thread
From: Thorsten Blum @ 2024-03-28 14:00 UTC (permalink / raw)
  To: Jason Wessel, Daniel Thompson, Douglas Anderson
  Cc: Christophe JAILLET, Yuran Pereira, kgdb-bugreport, linux-kernel,
	Thorsten Blum

Fixes the following Coccinelle/coccicheck warning reported by
string_choices.cocci:

	opportunity for str_plural(days)

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

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index d05066cb40b2..664bae55f2c9 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2517,7 +2517,7 @@ static int kdb_summary(int argc, const char **argv)
 	if (val.uptime > (24*60*60)) {
 		int days = val.uptime / (24*60*60);
 		val.uptime %= (24*60*60);
-		kdb_printf("%d day%s ", days, days == 1 ? "" : "s");
+		kdb_printf("%d day%s ", days, str_plural(days));
 	}
 	kdb_printf("%02ld:%02ld\n", val.uptime/(60*60), (val.uptime/60)%60);
 
-- 
2.44.0


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

* Re: [PATCH] kdb: Use str_plural() to fix Coccinelle warning
  2024-03-28 14:00 [PATCH] kdb: Use str_plural() to fix Coccinelle warning Thorsten Blum
@ 2024-03-28 14:31 ` Doug Anderson
  2024-04-21 23:26   ` [RESEND PATCH] " Thorsten Blum
  2024-04-26 17:24 ` [PATCH] " Daniel Thompson
  1 sibling, 1 reply; 4+ messages in thread
From: Doug Anderson @ 2024-03-28 14:31 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Jason Wessel, Daniel Thompson, Christophe JAILLET, Yuran Pereira,
	kgdb-bugreport, linux-kernel

Hi,

On Thu, Mar 28, 2024 at 7:03 AM Thorsten Blum <thorsten.blum@toblux.com> wrote:
>
> Fixes the following Coccinelle/coccicheck warning reported by
> string_choices.cocci:
>
>         opportunity for str_plural(days)
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> ---
>  kernel/debug/kdb/kdb_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

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

* [RESEND PATCH] kdb: Use str_plural() to fix Coccinelle warning
  2024-03-28 14:31 ` Doug Anderson
@ 2024-04-21 23:26   ` Thorsten Blum
  0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2024-04-21 23:26 UTC (permalink / raw)
  To: dianders
  Cc: christophe.jaillet, daniel.thompson, jason.wessel,
	kgdb-bugreport, linux-kernel, thorsten.blum, yuran.pereira

Fixes the following Coccinelle/coccicheck warning reported by
string_choices.cocci:

	opportunity for str_plural(days)

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---
 kernel/debug/kdb/kdb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index d05066cb40b2..664bae55f2c9 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2517,7 +2517,7 @@ static int kdb_summary(int argc, const char **argv)
 	if (val.uptime > (24*60*60)) {
 		int days = val.uptime / (24*60*60);
 		val.uptime %= (24*60*60);
-		kdb_printf("%d day%s ", days, days == 1 ? "" : "s");
+		kdb_printf("%d day%s ", days, str_plural(days));
 	}
 	kdb_printf("%02ld:%02ld\n", val.uptime/(60*60), (val.uptime/60)%60);
 
-- 
2.44.0


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

* Re: [PATCH] kdb: Use str_plural() to fix Coccinelle warning
  2024-03-28 14:00 [PATCH] kdb: Use str_plural() to fix Coccinelle warning Thorsten Blum
  2024-03-28 14:31 ` Doug Anderson
@ 2024-04-26 17:24 ` Daniel Thompson
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Thompson @ 2024-04-26 17:24 UTC (permalink / raw)
  To: Jason Wessel, Douglas Anderson, Thorsten Blum
  Cc: Christophe JAILLET, Yuran Pereira, kgdb-bugreport, linux-kernel


On Thu, 28 Mar 2024 15:00:17 +0100, Thorsten Blum wrote:
> Fixes the following Coccinelle/coccicheck warning reported by
> string_choices.cocci:
> 
> 	opportunity for str_plural(days)
> 
> 

Applied, thanks!

[1/1] kdb: Use str_plural() to fix Coccinelle warning
      commit: 5b6d8ef6f056d8130168746c5459d7a3fb494859

Best regards,
-- 
Daniel Thompson <daniel.thompson@linaro.org>


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

end of thread, other threads:[~2024-04-26 17:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 14:00 [PATCH] kdb: Use str_plural() to fix Coccinelle warning Thorsten Blum
2024-03-28 14:31 ` Doug Anderson
2024-04-21 23:26   ` [RESEND PATCH] " Thorsten Blum
2024-04-26 17:24 ` [PATCH] " Daniel Thompson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.