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]
Date:   Thu, 28 Sep 2023 11:38:38 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     David Laight <david.laight@...lab.com>,
        linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
        Jason@...c4.com, hch@...radead.org,
        andriy.shevchenko@...ux.intel.com, akpm@...ux-foundation.org
Subject: Re: + minmax-add-umina-b-and-umaxa-b.patch added to
 mm-nonmm-unstable branch

On Wed, Sep 27, 2023 at 09:00:37PM +0100, Matthew Wilcox wrote:
> On Wed, Sep 27, 2023 at 10:21:41PM +0300, Alexey Dobriyan wrote:
> > On Wed, Sep 27, 2023 at 10:30:33AM -0700, Andrew Morton wrote:
> > > +#define umin(x, y)	\
> > > +	__careful_cmp((x) + 0u + 0ul + 0ull, (y) + 0u + 0ul + 0ull, <)
> > 
> > kmin() and kmax() are (of course!) much better names.
> 
> it's unsigned, not user.

Yes, but the same idea applies to signed types:

min, max require identical types
min_t force type
kmin, kmax are relaxed min/max versions if signednesses match.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ