]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
md/raid0: use str_plural helper in dump_zones
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 27 May 2026 14:19:33 +0000 (16:19 +0200)
committerYu Kuai <yukuai@fygo.io>
Sun, 31 May 2026 11:09:20 +0000 (19:09 +0800)
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>
drivers/md/raid0.c

index 5e38a51e349ad3a7cb944c3c830a5f411e373a40..699c2de8983a501d5c35e3d26b2aa30996cb3d24 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/seq_file.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/string_choices.h>
 #include <trace/events/block.h>
 #include "md.h"
 #include "raid0.h"
@@ -43,7 +44,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;