]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cxl/hdm: Use str_plural() to simplify the code
authorXichao Zhao <zhao.xichao@vivo.com>
Mon, 11 Aug 2025 12:25:19 +0000 (20:25 +0800)
committerDave Jiang <dave.jiang@intel.com>
Tue, 12 Aug 2025 21:39:24 +0000 (14:39 -0700)
Use the string choice helper function str_plural() to simplify the code.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20250811122519.543554-1-zhao.xichao@vivo.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/hdm.c

index e9e1d555cec65c46222d74674b144fce5b8baa1d..37176c0a781f51e30ae886eed3aa1973cb1b913a 100644 (file)
@@ -197,7 +197,7 @@ struct cxl_hdm *devm_cxl_setup_hdm(struct cxl_port *port,
         */
        if (should_emulate_decoders(info)) {
                dev_dbg(dev, "Fallback map %d range register%s\n", info->ranges,
-                       info->ranges > 1 ? "s" : "");
+                       str_plural(info->ranges));
                cxlhdm->decoder_count = info->ranges;
        }