]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
minmax: simplify and clarify min_t()/max_t() implementation
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 28 Jul 2024 20:50:01 +0000 (13:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Oct 2025 11:40:43 +0000 (13:40 +0200)
commitb2f31ae2cc2447f422604f5c7ad78490c81b33a2
treeb231e6c77cfe8618074323df24825f8107a5d570
parentab55a0c6a58e01d90f3ac5e3f4e8965215f99525
minmax: simplify and clarify min_t()/max_t() implementation

commit 017fa3e89187848fd056af757769c9e66ac3e93d upstream.

This simplifies the min_t() and max_t() macros by no longer making them
work in the context of a C constant expression.

That means that you can no longer use them for static initializers or
for array sizes in type definitions, but there were only a couple of
such uses, and all of them were converted (famous last words) to use
MIN_T/MAX_T instead.

Cc: David Laight <David.Laight@aculab.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/minmax.h