lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d4aeea1-fff4-4e3a-a83f-67c429afa653@arm.com>
Date: Wed, 2 Jul 2025 09:42:59 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Thorsten Blum <thorsten.blum@...ux.dev>,
 Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/cma: Use str_plural() in
 cma_declare_contiguous_multi()

On 30/06/25 6:53 PM, Thorsten Blum wrote:
> Use the string choice helper function str_plural() to simplify the code
> and to fix the following Coccinelle/coccicheck warning reported by
> string_choices.cocci:
> 
>   opportunity for str_plural(nr)
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
>  mm/cma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/cma.c b/mm/cma.c
> index c0b2630a1b81..c40d53298801 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -22,6 +22,7 @@
>  #include <linux/mm.h>
>  #include <linux/sizes.h>
>  #include <linux/slab.h>
> +#include <linux/string_choices.h>
>  #include <linux/log2.h>
>  #include <linux/cma.h>
>  #include <linux/highmem.h>
> @@ -548,8 +549,7 @@ int __init cma_declare_contiguous_multi(phys_addr_t total_size,
>  			(unsigned long)total_size / SZ_1M);
>  	else
>  		pr_info("Reserved %lu MiB in %d range%s\n",
> -			(unsigned long)total_size / SZ_1M, nr,
> -			nr > 1 ? "s" : "");
> +			(unsigned long)total_size / SZ_1M, nr, str_plural(nr));
>  	return ret;
>  }
>


Reviewed-by: Anshuman Khandual <anshuman.khandual@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ