]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hpet: Use str_plural() to simplify the code
authorXichao Zhao <zhao.xichao@vivo.com>
Mon, 11 Aug 2025 12:23:58 +0000 (20:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Aug 2025 10:50:36 +0000 (12:50 +0200)
Use the string choice helper function str_plural() to simplify the code.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Link: https://lore.kernel.org/r/20250811122358.542190-1-zhao.xichao@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/hpet.c

index 0713ea2b2a51cc302a91e4c4b7e6692abe557b68..4f5ccd3a1f56671efc3388bd75b89207c173cfc9 100644 (file)
@@ -867,7 +867,7 @@ int hpet_alloc(struct hpet_data *hdp)
 
        printk(KERN_INFO "hpet%u: at MMIO 0x%lx, IRQ%s",
                hpetp->hp_which, hdp->hd_phys_address,
-               hpetp->hp_ntimer > 1 ? "s" : "");
+               str_plural(hpetp->hp_ntimer));
        for (i = 0; i < hpetp->hp_ntimer; i++)
                printk(KERN_CONT "%s %u", i > 0 ? "," : "", hdp->hd_irq[i]);
        printk(KERN_CONT "\n");