minmax.h: Cleanups and minor optimisations
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 23 repliesIn review 6 of 7 applied
Patches in v1 6 of 7 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | minmax.h: Add whitespace around operators and after commasinclude/ | +17 | 0 replies | |
| 2/7 | minmax.h: Update some commentsinclude/ | +24 | 0 replies | Applied |
| 3/7 | minmax.h: Reduce the #define expansion of min(), max() and clamp()include/ | +12 | 0 replies | Applied |
| 4/7 | minmax.h: Use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()include/ | +1 | 22 replies | Applied |
| 5/7 | minmax.h: Move all the clamp() definitions after the min/max() onesinclude/ | +51 | 0 replies | Applied |
| 6/7 | minmax.h: Simplify the variants of clamp()include/ | +12 | 1 reply | Applied |
| 7/7 | minmax.h: Remove some #defines that are only expanded onceinclude/ | +6 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH next 0/7] minmax.h: Cleanups and minor optimisations
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(-)
Signature · 5 lines
2.17.1 - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)