]> git.karo-electronics.de Git - linux-beck.git/blobdiff - include/linux/kernel.h
Merge branch 'for-2.6.37/core' of git://git.kernel.dk/linux-2.6-block
[linux-beck.git] / include / linux / kernel.h
index 1759ba5adce845fa08d4b1fd899920ac65436938..edef168a04064b61161cff70e9e8d803aa2ed1a4 100644 (file)
@@ -651,6 +651,16 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
        (void) (&_max1 == &_max2);              \
        _max1 > _max2 ? _max1 : _max2; })
 
+/**
+ * min_not_zero - return the minimum that is _not_ zero, unless both are zero
+ * @x: value1
+ * @y: value2
+ */
+#define min_not_zero(x, y) ({                  \
+       typeof(x) __x = (x);                    \
+       typeof(y) __y = (y);                    \
+       __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
+
 /**
  * clamp - return a value clamped to a given range with strict typechecking
  * @val: current value