linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pnp: isapnp: use str_plural() to simplify the code
@ 2025-08-18  8:24 Xichao Zhao
  2025-08-25 15:31 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Xichao Zhao @ 2025-08-18  8:24 UTC (permalink / raw)
  To: perex, rafael; +Cc: linux-acpi, linux-kernel, Xichao Zhao

Use the string choice helper function str_plural() to simplify the code.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/pnp/isapnp/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index d2ff76e74a05..219f96f2aaaf 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -27,6 +27,7 @@
 #include <linux/init.h>
 #include <linux/isapnp.h>
 #include <linux/mutex.h>
+#include <linux/string_choices.h>
 #include <asm/io.h>
 
 #include "../base.h"
@@ -1037,7 +1038,7 @@ static int __init isapnp_init(void)
 	if (cards)
 		printk(KERN_INFO
 		       "isapnp: %i Plug & Play card%s detected total\n", cards,
-		       cards > 1 ? "s" : "");
+		       str_plural(cards));
 	else
 		printk(KERN_INFO "isapnp: No Plug & Play card found\n");
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pnp: isapnp: use str_plural() to simplify the code
  2025-08-18  8:24 [PATCH] pnp: isapnp: use str_plural() to simplify the code Xichao Zhao
@ 2025-08-25 15:31 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2025-08-25 15:31 UTC (permalink / raw)
  To: Xichao Zhao; +Cc: perex, rafael, linux-acpi, linux-kernel

On Mon, Aug 18, 2025 at 10:25 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> Use the string choice helper function str_plural() to simplify the code.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>  drivers/pnp/isapnp/core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
> index d2ff76e74a05..219f96f2aaaf 100644
> --- a/drivers/pnp/isapnp/core.c
> +++ b/drivers/pnp/isapnp/core.c
> @@ -27,6 +27,7 @@
>  #include <linux/init.h>
>  #include <linux/isapnp.h>
>  #include <linux/mutex.h>
> +#include <linux/string_choices.h>
>  #include <asm/io.h>
>
>  #include "../base.h"
> @@ -1037,7 +1038,7 @@ static int __init isapnp_init(void)
>         if (cards)
>                 printk(KERN_INFO
>                        "isapnp: %i Plug & Play card%s detected total\n", cards,
> -                      cards > 1 ? "s" : "");
> +                      str_plural(cards));
>         else
>                 printk(KERN_INFO "isapnp: No Plug & Play card found\n");
>
> --

Applied as 6.18 material, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-25 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18  8:24 [PATCH] pnp: isapnp: use str_plural() to simplify the code Xichao Zhao
2025-08-25 15:31 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).