diff options
| author | riastradh <riastradh@NetBSD.org> | 2021-12-19 00:48:09 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2021-12-19 00:48:09 +0000 |
| commit | f099464ee5dba10342f2de772c251ae8a4270328 (patch) | |
| tree | a487448f1232cbac8258bb065b8dce5f15b5816c /sys/external/bsd/common/include/linux | |
| parent | 45601a1649a87b9e656a691b9d92331697ee9d82 (diff) | |
Actually use the type in min_t/max_t.
Otherwise we do not get the truncation we might expect. Probably not
a big deal, but we should match the semantics.
XXX pullup-7
XXX pullup-8
Diffstat (limited to 'sys/external/bsd/common/include/linux')
| -rw-r--r-- | sys/external/bsd/common/include/linux/kernel.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/external/bsd/common/include/linux/kernel.h b/sys/external/bsd/common/include/linux/kernel.h index e0b6ff745d6..7d870197151 100644 --- a/sys/external/bsd/common/include/linux/kernel.h +++ b/sys/external/bsd/common/include/linux/kernel.h @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.28 2021/12/19 00:47:47 riastradh Exp $ */ +/* $NetBSD: kernel.h,v 1.29 2021/12/19 00:48:09 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -89,8 +89,8 @@ #define min(X, Y) MIN(X, Y) #define max(X, Y) MAX(X, Y) -#define max_t(T, X, Y) MAX(X, Y) -#define min_t(T, X, Y) MIN(X, Y) +#define max_t(T, X, Y) MAX((T)(X), (T)(Y)) +#define min_t(T, X, Y) MIN((T)(X), (T)(Y)) #define clamp_t(T, X, MIN, MAX) min_t(T, max_t(T, X, MIN), MAX) #define clamp(X, MN, MX) MIN(MAX(X, MN), MX) |
