* [PATCH] dm vdo: Use str_plural() to simplify the code
@ 2025-08-28 11:27 Xichao Zhao
2025-08-28 12:07 ` Li Nan
0 siblings, 1 reply; 2+ messages in thread
From: Xichao Zhao @ 2025-08-28 11:27 UTC (permalink / raw)
To: song, yukuai3; +Cc: linux-raid, linux-kernel, Xichao Zhao
Use the string choice helper function str_plural() to simplify the code.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/md/raid0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index cbe2a9054cb9..a2e59a8d441f 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -41,7 +41,7 @@ static void dump_zones(struct mddev *mddev)
int raid_disks = conf->strip_zone[0].nb_dev;
pr_debug("md: RAID0 configuration for %s - %d zone%s\n",
mdname(mddev),
- conf->nr_strip_zones, conf->nr_strip_zones==1?"":"s");
+ conf->nr_strip_zones, str_plural(conf->nr_strip_zones));
for (j = 0; j < conf->nr_strip_zones; j++) {
char line[200];
int len = 0;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dm vdo: Use str_plural() to simplify the code
2025-08-28 11:27 [PATCH] dm vdo: Use str_plural() to simplify the code Xichao Zhao
@ 2025-08-28 12:07 ` Li Nan
0 siblings, 0 replies; 2+ messages in thread
From: Li Nan @ 2025-08-28 12:07 UTC (permalink / raw)
To: Xichao Zhao, song, yukuai3; +Cc: linux-raid, linux-kernel
在 2025/8/28 19:27, Xichao Zhao 写道:
> Use the string choice helper function str_plural() to simplify the code.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
> drivers/md/raid0.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
> index cbe2a9054cb9..a2e59a8d441f 100644
> --- a/drivers/md/raid0.c
> +++ b/drivers/md/raid0.c
Why subject is 'dm vdo'? The modified file is raid0. Please check before
sending.
> @@ -41,7 +41,7 @@ static void dump_zones(struct mddev *mddev)
> int raid_disks = conf->strip_zone[0].nb_dev;
> pr_debug("md: RAID0 configuration for %s - %d zone%s\n",
> mdname(mddev),
> - conf->nr_strip_zones, conf->nr_strip_zones==1?"":"s");
> + conf->nr_strip_zones, str_plural(conf->nr_strip_zones));
> for (j = 0; j < conf->nr_strip_zones; j++) {
> char line[200];
> int len = 0;
--
Thanks,
Nan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-28 12:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 11:27 [PATCH] dm vdo: Use str_plural() to simplify the code Xichao Zhao
2025-08-28 12:07 ` Li Nan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).