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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 8 Apr 2024 13:48:34 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Thorsten Blum <thorsten.blum@...lux.com>
Cc: Vasily Gorbik <gor@...ux.ibm.com>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Sven Schnelle <svens@...ux.ibm.com>,
        Frederic Weisbecker <frederic@...nel.org>,
        Ilya Leoshkevich <iii@...ux.ibm.com>, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] s390/smp: Use min() to fix Coccinelle warning

On Mon, Apr 08, 2024 at 12:51:25PM +0200, Thorsten Blum wrote:
> Fixes the following Coccinelle/coccicheck warning reported by
> minmax.cocci:
> 
> 	WARNING opportunity for min()
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@...lux.com>
> ---
>  arch/s390/kernel/smp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
> index 0324649aae0a..d69cf2475744 100644
> --- a/arch/s390/kernel/smp.c
> +++ b/arch/s390/kernel/smp.c
> @@ -1205,7 +1205,7 @@ static int __init s390_smp_init(void)
>  
>  	rc = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "s390/smp:online",
>  			       smp_cpu_online, smp_cpu_pre_down);
> -	rc = rc <= 0 ? rc : 0;
> +	rc = min(rc, 0);

No. This decreases readability. Please do not send such patches just
because Coccinelle reports something.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ