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: <20240827175802.GA1903074@kernel.org>
Date: Tue, 27 Aug 2024 18:58:02 +0100
From: Simon Horman <horms@...nel.org>
To: Hongbo Li <lihongbo22@...wei.com>
Cc: David Howells <dhowells@...hat.com>, johannes@...solutions.net,
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, allison.henderson@...cle.com, dsahern@...nel.org,
	pshelar@....org, linux-wireless@...r.kernel.org,
	netdev@...r.kernel.org, rds-devel@....oracle.com,
	dccp@...r.kernel.org, dev@...nvswitch.org,
	linux-afs@...ts.infradead.org
Subject: Re: [PATCH net-next 7/8] net/rxrpc: Use min() to simplify the code

On Mon, Aug 26, 2024 at 10:50:03AM +0800, Hongbo Li wrote:
> 
> 
> On 2024/8/24 20:06, David Howells wrote:
> > Hongbo Li <lihongbo22@...wei.com> wrote:
> > 
> > > -	summary.ack_reason = (sp->ack.reason < RXRPC_ACK__INVALID ?
> > > -			      sp->ack.reason : RXRPC_ACK__INVALID);
> > > +	summary.ack_reason = min(sp->ack.reason, RXRPC_ACK__INVALID);
> > 
> > Can you use umin() rather than min(), please?
> > 
> 
> I see reason is u8, so may I use min_t(u8, sp->ack.reason,
> RXRPC_ACK__INVALID)?

I believe that umin was added precisely to avoid such constructions.

See: 80fcac55385c ("minmax: add umin(a, b) and umax(a, b)")
     https://git.kernel.org/torvalds/c/80fcac55385c

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ