Lines Matching full:hi
107 #define __clamp(val, lo, hi) \ argument
108 ((val) >= (hi) ? (hi) : ((val) <= (lo) ? (lo) : (val)))
110 #define __clamp_once(val, lo, hi, uval, ulo, uhi) ({ \ argument
113 __auto_type uhi = (hi); \
114 static_assert(__builtin_choose_expr(__is_constexpr((lo) > (hi)), \
115 (lo) <= (hi), true), \
116 "clamp() low limit " #lo " greater than high limit " #hi); \
117 BUILD_BUG_ON_MSG(!__types_ok3(val,lo,hi,uval,ulo,uhi), \
118 "clamp("#val", "#lo", "#hi") signedness error"); \
121 #define __careful_clamp(val, lo, hi) \ argument
122 __clamp_once(val, lo, hi, __UNIQUE_ID(v_), __UNIQUE_ID(l_), __UNIQUE_ID(h_))
193 * @hi: highest allowable value
195 * This macro does strict typechecking of @lo/@hi to make sure they are of the
198 #define clamp(val, lo, hi) __careful_clamp(val, lo, hi) argument
271 * @hi: maximum allowable value
276 #define clamp_t(type, val, lo, hi) __careful_clamp((type)(val), (type)(lo), (type)(hi)) argument
282 * @hi: maximum allowable value
286 * type and @lo and @hi are literals that will otherwise be assigned a signed
289 #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) argument