From 8d3a8741f7d65dab28c586af9ee0063318d92a7f Mon Sep 17 00:00:00 2001 From: Hagen Paul Pfeifer Date: Tue, 26 Oct 2010 14:22:21 -0700 Subject: [PATCH] --- yaml --- r: 217509 b: refs/heads/master c: f27c85c56b32c42bcc54a43189c1e00fdceb23ec h: refs/heads/master i: 217507: 4b28012c48d56b7a52f726072a32346a59fa8981 v: v3 --- [refs] | 2 +- trunk/include/linux/kernel.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ecb1b1f87e49..66fe4d4f7954 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c5c6dd4e2dce3cb4d705d97183bc42b4e33e2606 +refs/heads/master: f27c85c56b32c42bcc54a43189c1e00fdceb23ec diff --git a/trunk/include/linux/kernel.h b/trunk/include/linux/kernel.h index edef168a0406..8e786a27cfe6 100644 --- a/trunk/include/linux/kernel.h +++ b/trunk/include/linux/kernel.h @@ -651,6 +651,24 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } (void) (&_max1 == &_max2); \ _max1 > _max2 ? _max1 : _max2; }) +#define min3(x, y, z) ({ \ + typeof(x) _min1 = (x); \ + typeof(y) _min2 = (y); \ + typeof(z) _min3 = (z); \ + (void) (&_min1 == &_min2); \ + (void) (&_min1 == &_min3); \ + _min1 < _min2 ? (_min1 < _min3 ? _min1 : _min3) : \ + (_min2 < _min3 ? _min2 : _min3); }) + +#define max3(x, y, z) ({ \ + typeof(x) _max1 = (x); \ + typeof(y) _max2 = (y); \ + typeof(z) _max3 = (z); \ + (void) (&_max1 == &_max2); \ + (void) (&_max1 == &_max3); \ + _max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \ + (_max2 > _max3 ? _max2 : _max3); }) + /** * min_not_zero - return the minimum that is _not_ zero, unless both are zero * @x: value1