Some tidyups and minor changes to minmax.h.
Patches 1, 2 and 5 have no functional changes.
Patch 3 changes the statically_true() tests in __types_ok() to use the
local 'unique' variables rather than the caller supplied expressions.
This will reduce the line length of the preprocessor output.
Patch 4 uses statically_true() for clamp's (lo) < (hi) check.
Patch 6 passes '__auto_type' as the 'fixed type' to reduce the number
of variants.
Patch 7 removes a level of indirection from __sign_use() and
__is_nonneg().
David Laight (7):
1) Add whitespace around operators and after commas
2) Update some comments
3) Reduce the #define expansion of min(), max() and clamp()
4) Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()
5) Move all the clamp() definitions after the min/max() ones.
6) Simplify the variants of clamp()
7) Remove some #defines that are only expanded once
include/linux/minmax.h | 205 +++++++++++++++++++----------------------
1 file changed, 95 insertions(+), 110 deletions(-)
--
2.17.1
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)