Skip to content

Commit 11bdf36

Browse files
Xichao Zhaoweiny2
authored andcommitted
nvdimm: 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> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
1 parent f83ec76 commit 11bdf36

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/nvdimm/namespace_devs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ static struct device **scan_labels(struct nd_region *nd_region)
19831983
}
19841984

19851985
dev_dbg(&nd_region->dev, "discovered %d namespace%s\n", count,
1986-
count == 1 ? "" : "s");
1986+
str_plural(count));
19871987

19881988
if (count == 0) {
19891989
struct nd_namespace_pmem *nspm;

drivers/nvdimm/region.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int nd_region_probe(struct device *dev)
7070
* "<async-registered>/<total>" namespace count.
7171
*/
7272
dev_err(dev, "failed to register %d namespace%s, continuing...\n",
73-
err, err == 1 ? "" : "s");
73+
err, str_plural(err));
7474
return 0;
7575
}
7676

0 commit comments

Comments
 (0)