[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <c50365d214e04f9ba256d417c8bebbc0@AcuMS.aculab.com>
Date: Mon, 18 Nov 2024 19:09:06 +0000
From: David Laight <David.Laight@...LAB.COM>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: 'Arnd Bergmann' <arnd@...nel.org>, "'linux-kernel@...r.kernel.org'"
<linux-kernel@...r.kernel.org>, 'Jens Axboe' <axboe@...nel.dk>, "'Matthew
Wilcox'" <willy@...radead.org>, 'Christoph Hellwig' <hch@...radead.org>,
'Andrew Morton' <akpm@...ux-foundation.org>, 'Andy Shevchenko'
<andriy.shevchenko@...ux.intel.com>, 'Dan Carpenter'
<dan.carpenter@...aro.org>, "'Jason A . Donenfeld'" <Jason@...c4.com>,
"'pedro.falcato@...il.com'" <pedro.falcato@...il.com>, 'Mateusz Guzik'
<mjguzik@...il.com>, "'linux-mm@...ck.org'" <linux-mm@...ck.org>, "'Lorenzo
Stoakes'" <lorenzo.stoakes@...cle.com>
Subject: [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(-)
--
2.17.1
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists