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] [thread-next>] [day] [month] [year] [list]
Message-ID: <wv2ygjx2ste2hfusgp7apsp76wufeegrd26kdkzqmergwhwfqd@spof2npy32p5>
Date: Wed, 30 Apr 2025 10:27:29 +0200
From: Carlos Maiolino <cem@...nel.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: linux-xfs@...r.kernel.org, Chandan Babu R <chandanbabu@...nel.org>, 
	"Darrick J. Wong" <djwong@...nel.org>, LKML <linux-kernel@...r.kernel.org>, 
	kernel-janitors@...r.kernel.org, Qasim Ijaz <qasdev00@...il.com>, 
	Natalie Vock <natalie.vock@....de>
Subject: Re: [PATCH] xfs: Simplify maximum determination in
 xrep_calc_ag_resblks()

On Sat, Mar 01, 2025 at 11:30:52AM +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Sat, 1 Mar 2025 11:24:52 +0100
> 
> Reduce nested max() calls by a single max3() call in this
> function implementation.
> 
> The source code was transformed by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>  fs/xfs/scrub/repair.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 3b5288d3ef4e..6b23a3943907 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -382,7 +382,7 @@ xrep_calc_ag_resblks(
>  			refcbt_sz);
>  	xfs_perag_put(pag);
> 
> -	return max(max(bnobt_sz, inobt_sz), max(rmapbt_sz, refcbt_sz));
> +	return max3(bnobt_sz, inobt_sz, max(rmapbt_sz, refcbt_sz));

I have nothing against the patch itself, but honestly I don't see how it
improves anything. It boils down to nesting comparison instructions too, and
doesn't make the code more clear IMHO.
So, unless somebody else has a stronger reason to have this change, NAK from my
side.

Carlos

>  }
> 
>  #ifdef CONFIG_XFS_RT
> --
> 2.48.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ