Skip to content

Commit 717359a

Browse files
tobluxYu Kuai
authored andcommitted
md/raid0: use str_plural helper in dump_zones
Replace the manual ternary "s" pluralization with str_plural() to simplify the code. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://patch.msgid.link/20260527141932.1243503-2-thorsten.blum@linux.dev Signed-off-by: Yu Kuai <yukuai@fygo.io>
1 parent 909d9dc commit 717359a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/md/raid0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/seq_file.h>
1515
#include <linux/module.h>
1616
#include <linux/slab.h>
17+
#include <linux/string_choices.h>
1718
#include <trace/events/block.h>
1819
#include "md.h"
1920
#include "raid0.h"
@@ -43,7 +44,7 @@ static void dump_zones(struct mddev *mddev)
4344
int raid_disks = conf->strip_zone[0].nb_dev;
4445
pr_debug("md: RAID0 configuration for %s - %d zone%s\n",
4546
mdname(mddev),
46-
conf->nr_strip_zones, conf->nr_strip_zones==1?"":"s");
47+
conf->nr_strip_zones, str_plural(conf->nr_strip_zones));
4748
for (j = 0; j < conf->nr_strip_zones; j++) {
4849
char line[200];
4950
int len = 0;

0 commit comments

Comments
 (0)