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@vivo.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://patch.msgid.link/20260531230804.254962-9-samuel.thibault@ens-lyon.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Xichao Zhao
2026-06-01 01:07:57 +02:00
committed by Greg Kroah-Hartman
parent 5c3949ef38
commit 768ce60dc8

View File

@@ -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);
}
}