[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1334437288.2528.111.camel@twins>
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