Module Name: src Committed By: riastradh Date: Sun Dec 19 00:48:09 UTC 2021
Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: 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 To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.28 src/sys/external/bsd/common/include/linux/kernel.h:1.29 --- src/sys/external/bsd/common/include/linux/kernel.h:1.28 Sun Dec 19 00:47:47 2021 +++ src/sys/external/bsd/common/include/linux/kernel.h Sun Dec 19 00:48:09 2021 @@ -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)