[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250807085930.429665-1-zhao.xichao@vivo.com>
Date: Thu, 7 Aug 2025 16:59:30 +0800
From: Xichao Zhao <zhao.xichao@...o.com>
To: w.d.hubbs@...il.com,
chris@...-brannons.com,
kirk@...sers.ca,
samuel.thibault@...-lyon.org
Cc: speakup@...ux-speakup.org,
linux-kernel@...r.kernel.org,
Xichao Zhao <zhao.xichao@...o.com>
Subject: [PATCH] accessibility: Use str_plural() to simplify the code
Use the string choice helper function str_plural() to simplify the code.
Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
---
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 0dfdb6608e02..57139971e997 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.34.1
Powered by blists - more mailing lists