summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-08-07 20:34:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-08-07 20:34:39 +0200
commit45615e3ec10c38298c1b9780e13a884aff49bae1 (patch)
tree9846c95af6152cbce9e7891e26f6503054e2f6b1 /include/linux
parent7782c08047fc44874caf1c03c153a070f9ac557a (diff)
parent92466472c2116b93ef5ed957a559fe84b9d88c80 (diff)
downloadbarebox-45615e3ec10c38298c1b9780e13a884aff49bae1.tar.gz
barebox-45615e3ec10c38298c1b9780e13a884aff49bae1.tar.xz
Merge branch 'for-next/usb-host'
Conflicts: drivers/usb/core/Makefile
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kernel.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d512adcea1..98f12e1b93 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -34,6 +34,24 @@
(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); })
+
/**
* clamp - return a value clamped to a given range with strict typechecking
* @val: current value