]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - include/linux/kernel.h
linux header updates
[bcachefs-tools-debian] / include / linux / kernel.h
index 6f56748966cfaf8a89708cbcee0c056acd41a1c2..ef0b1a7d5ca39ffc04d2a7e2f753ff2017d921c3 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/byteorder.h>
 #include <linux/compiler.h>
 #include <linux/math.h>
+#include <linux/minmax.h>
 
 #define BIT(nr)                        (1UL << (nr))
 #define BIT_ULL(nr)            (1ULL << (nr))
 #define struct_group(NAME, MEMBERS...) \
        __struct_group(/* no tag */, NAME, /* no attrs */, MEMBERS)
 
-#define max(x, y) ({                           \
-       typeof(x) _max1 = (x);                  \
-       typeof(y) _max2 = (y);                  \
-       (void) (&_max1 == &_max2);              \
-       _max1 > _max2 ? _max1 : _max2; })
-
-#define min(x, y) ({                           \
-       typeof(x) _min1 = (x);                  \
-       typeof(y) _min2 = (y);                  \
-       (void) (&_min1 == &_min2);              \
-       _min1 < _min2 ? _min1 : _min2; })
-
-#define min_t(type, x, y) ({                   \
-       type __min1 = (x);                      \
-       type __min2 = (y);                      \
-       __min1 < __min2 ? __min1: __min2; })
-
-#define max_t(type, x, y) ({                   \
-       type __max1 = (x);                      \
-       type __max2 = (y);                      \
-       __max1 > __max2 ? __max1: __max2; })
-
-#define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
-
 #define swap(a, b) \
        do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)