2024-03-28 14:33:01

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH] kdb: Use str_plural() to fix Coccinelle warning

Hi,

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

Reviewed-by: Douglas Anderson <[email protected]>


2024-04-22 08:55:44

by Thorsten Blum

[permalink] [raw]
Subject: [RESEND PATCH] kdb: Use str_plural() to fix Coccinelle warning

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

opportunity for str_plural(days)

Signed-off-by: Thorsten Blum <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
---
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