From: Thorsten Blum Date: Thu, 28 Mar 2024 14:00:17 +0000 (+0100) Subject: kdb: Use str_plural() to fix Coccinelle warning X-Git-Tag: v6.10-rc1~101^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b6d8ef6f056d8130168746c5459d7a3fb494859;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20240328140015.388654-3-thorsten.blum@toblux.com Signed-off-by: Daniel Thompson --- diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index d05066cb40b2e..664bae55f2c9d 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);