[PATCH 08/15] accessibility: Use str_plural() to simplify the code
From: Samuel Thibault
Date: Sun May 31 2026 - 19:14:26 EST
From: Xichao Zhao <zhao.xichao@xxxxxxxx>
Use the string choice helper function str_plural() to simplify the code.
Signed-off-by: Xichao Zhao <zhao.xichao@xxxxxxxx>
Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
drivers/accessibility/speakup/kobjects.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/accessibility/speakup/kobjects.c b/drivers/accessibility/speakup/kobjects.c
index 9ff7a4c680db..a73b478e06de 100644
--- a/drivers/accessibility/speakup/kobjects.c
+++ b/drivers/accessibility/speakup/kobjects.c
@@ -98,7 +98,7 @@ static void report_char_chartab_status(int reset, int received, int used,
if (rejected)
snprintf(buf + (len - 1), sizeof(buf) - (len - 1),
" with %d reject%s\n",
- rejected, rejected > 1 ? "s" : "");
+ rejected, str_plural(rejected));
pr_info("%s", buf);
}
}
@@ -740,7 +740,7 @@ static void report_msg_status(int reset, int received, int used,
if (rejected)
snprintf(buf + (len - 1), sizeof(buf) - (len - 1),
" with %d reject%s\n",
- rejected, rejected > 1 ? "s" : "");
+ rejected, str_plural(rejected));
pr_info("%s", buf);
}
}
--
2.47.3