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:	Sat, 14 Apr 2012 23:01:28 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Sasha Levin <levinsasha928@...il.com>
Cc:	torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
	mingo@...e.hu, hpa@...or.com, tglx@...utronix.de,
	srivatsa.bhat@...ux.vnet.ibm.com, linux-kernel@...r.kernel.org
Subject: Re: [RFC 3/3] kernel.h: use new typechecking macros in min()/max()
 and friends

On Sat, 2012-04-14 at 18:14 -0400, Sasha Levin wrote:
>  #define min(x, y) ({                           \
> -       typeof(x) _min1 = (x);                  \
> -       typeof(y) _min2 = (y);                  \
> -       (void) (&_min1 == &_min2);              \
> -       _min1 < _min2 ? _min1 : _min2; })
> +       typecmp2((x), (y));                             \
> +       (x) < (y) ? (x) : (y); }) 

Problem with this is that it evaluates x and y multiple times.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ