* + minmaxh-update-the-stale-x-versus-ux-comment.patch added to mm-nonmm-unstable branch
@ 2026-08-29 23:42 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-29 23:42 UTC (permalink / raw)
To: mm-commits, hpa, david.laight.linux, zhanxusheng, akpm
The patch titled
Subject: minmax.h: update the stale 'x' versus 'ux' comment
has been added to the -mm mm-nonmm-unstable branch. Its filename is
minmaxh-update-the-stale-x-versus-ux-comment.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/minmaxh-update-the-stale-x-versus-ux-comment.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Zhan Xusheng <zhanxusheng@xiaomi.com>
Subject: minmax.h: update the stale 'x' versus 'ux' comment
Date: Mon, 17 Aug 2026 20:16:13 +0800
Commit b280bb27a9f7 ("minmax.h: reduce the #define expansion of min(),
max() and clamp()") made __sign_use(), __is_nonneg() and __types_ok() take
only 'ux', and commit a5743f32baec ("minmax.h: use BUILD_BUG_ON_MSG() for
the lo < hi test in clamp()") did the same for the clamp() limit test.
The comment describing the old split was added one patch earlier and was
never updated.
'ux' now carries the value check too, since __is_nonneg() tests it rather
than the original expression, and nothing here looks at the value of 'x'
any more: it is expanded only to initialise 'ux' and in the error message,
as the first of those changes intended.
Link: https://lore.kernel.org/20260817121613.3846511-1-zhanxusheng@xiaomi.com
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Cc: David Laight <david.laight.linux@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/minmax.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/include/linux/minmax.h~minmaxh-update-the-stale-x-versus-ux-comment
+++ a/include/linux/minmax.h
@@ -38,9 +38,9 @@
* Note that 'x' is the original expression, and 'ux' is the unique variable
* that contains the value.
*
- * We use 'ux' for pure type checking, and 'x' for when we need to look at the
- * value (but without evaluating it for side effects!
- * Careful to only ever evaluate it with sizeof() or __builtin_constant_p() etc).
+ * We use 'ux' for both the type and the value checks, so 'x' itself is only
+ * expanded twice: once to initialise 'ux', and once quoted in the error
+ * message.
*
* Pointers end up being checked by the normal C type rules at the actual
* comparison, and these expressions only need to be careful to not cause
_
Patches currently in -mm which might be from zhanxusheng@xiaomi.com are
minmaxh-update-the-stale-x-versus-ux-comment.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-29 23:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-29 23:42 + minmaxh-update-the-stale-x-versus-ux-comment.patch added to mm-nonmm-unstable branch Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox