diff mbox series

ACPI: Use str_plural() Function for Argument List Handling

Message ID 20240626135113.1527954-1-prabhakar.pujeri@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show
Series ACPI: Use str_plural() Function for Argument List Handling | expand

Commit Message

Prabhakar Pujeri June 26, 2024, 1:51 p.m. UTC
This patch enhances acpi_ut_display_predefined_method by using the str_plural()
function to handle argument pluralization. It improves readability and 
maintains consistency in displaying argument counts.

this patch generated using coccinelle.


Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@gmail.com>
---
 drivers/acpi/acpica/utpredef.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki July 1, 2024, 6:16 p.m. UTC | #1
On Wed, Jun 26, 2024 at 3:51 PM Prabhakar Pujeri
<prabhakar.pujeri@gmail.com> wrote:
>
>
> This patch enhances acpi_ut_display_predefined_method by using the str_plural()
> function to handle argument pluralization. It improves readability and
> maintains consistency in displaying argument counts.
>
> this patch generated using coccinelle.
>
>
> Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@gmail.com>
> ---
>  drivers/acpi/acpica/utpredef.c | 2 +-

ACPICA code changes need to be submitted to the upstream ACPICA
project on GitHub.  Once accepted there, a Linux patch can be
submitted with a Link: tag pointing to the corresponding upstream
ACPICA commit.

>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpica/utpredef.c b/drivers/acpi/acpica/utpredef.c
> index 29d2977d0746..5f148715f316 100644
> --- a/drivers/acpi/acpica/utpredef.c
> +++ b/drivers/acpi/acpica/utpredef.c
> @@ -248,7 +248,7 @@ acpi_ut_display_predefined_method(char *buffer,
>         printf("%4.4s    Requires %s%u argument%s",
>                this_name->info.name,
>                (this_name->info.argument_list & ARG_COUNT_IS_MINIMUM) ?
> -              "(at least) " : "", arg_count, arg_count != 1 ? "s" : "");
> +              "(at least) " : "", arg_count, str_plural(arg_count));
>
>         /* Display the types for any arguments */
>
> --
> 2.45.2
>
>
diff mbox series

Patch

diff --git a/drivers/acpi/acpica/utpredef.c b/drivers/acpi/acpica/utpredef.c
index 29d2977d0746..5f148715f316 100644
--- a/drivers/acpi/acpica/utpredef.c
+++ b/drivers/acpi/acpica/utpredef.c
@@ -248,7 +248,7 @@  acpi_ut_display_predefined_method(char *buffer,
 	printf("%4.4s    Requires %s%u argument%s",
 	       this_name->info.name,
 	       (this_name->info.argument_list & ARG_COUNT_IS_MINIMUM) ?
-	       "(at least) " : "", arg_count, arg_count != 1 ? "s" : "");
+	       "(at least) " : "", arg_count, str_plural(arg_count));
 
 	/* Display the types for any arguments */