Lines Matching +full:hi +full:- +full:z
1 /* SPDX-License-Identifier: GPL-2.0 */
10 * - avoid multiple evaluations of the arguments (so side-effects like
11 * "x++" happen only once) when non-constant.
12 * - perform strict type-checking (to generate warnings instead of
15 * - retain result as a constant expressions when called with only
41 * min - return minimum of two values of the same or compatible types
48 * max - return maximum of two values of the same or compatible types
55 * min3 - return minimum of three values
58 * @z: third value
60 #define min3(x, y, z) min((typeof(x))min(x, y), z) argument
63 * max3 - return maximum of three values
66 * @z: third value
68 #define max3(x, y, z) max((typeof(x))max(x, y), z) argument
71 * min_not_zero - return the minimum that is _not_ zero, unless both are zero
81 * clamp - return a value clamped to a given range with strict typechecking
84 * @hi: highest allowable value
86 * This macro does strict typechecking of @lo/@hi to make sure they are of the
89 #define clamp(val, lo, hi) min((typeof(val))max(val, lo), hi) argument
99 * min_t - return minimum of two values, using the specified type
107 * max_t - return maximum of two values, using the specified type
115 * clamp_t - return a value clamped to a given range using a given type
119 * @hi: maximum allowable value
124 #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi) argument
127 * clamp_val - return a value clamped to a given range using val's type
130 * @hi: maximum allowable value
134 * type and @lo and @hi are literals that will otherwise be assigned a signed
137 #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) argument
140 * swap - swap values of @a and @b