Date: Mon, 06 Apr 2026 19:55:35 +0000 From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron <dumbbell@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: ece26db020db - main - linuxkpi: Define `MIN_T()` and `MAX_T()` Message-ID: <69d40fb7.374b0.136d4d07@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=ece26db020db3a21b1a4c6b608f77a9ed5be5924 commit ece26db020db3a21b1a4c6b608f77a9ed5be5924 Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2026-03-08 11:18:22 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2026-04-06 19:28:10 +0000 linuxkpi: Define `MIN_T()` and `MAX_T()` There are the same as `MIN()` and `MAX()` except that they take a type to cast both arguments to compare. The DRM generic code started to use it in Linux 6.11. Reviewed by: bz, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55739 --- sys/compat/linuxkpi/common/include/linux/minmax.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/minmax.h b/sys/compat/linuxkpi/common/include/linux/minmax.h index fb8eb6f704b4..5040d7f9141e 100644 --- a/sys/compat/linuxkpi/common/include/linux/minmax.h +++ b/sys/compat/linuxkpi/common/include/linux/minmax.h @@ -60,6 +60,9 @@ type __max2 = (y); \ __max1 > __max2 ? __max1 : __max2; }) +#define MIN_T(type, x, y) MIN((type)(x), (type)(y)) +#define MAX_T(type, x, y) MAX((type)(x), (type)(y)) + #define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) #define clamp(x, lo, hi) min(max(x, lo), hi) #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69d40fb7.374b0.136d4d07>
