1CLAMP_VAL(9) Driver Basics CLAMP_VAL(9)
2
3
4
6 clamp_val - return a value clamped to a given range using val's type
7
9 clamp_val(val, min, max);
10
12 val
13 current value
14
15 min
16 minimum allowable value
17
18 max
19 maximum allowable value
20
22 This macro does no typechecking and uses temporary variables of
23 whatever type the input argument 'val' is. This is useful when val is
24 an unsigned type and min and max are literals that will otherwise be
25 assigned a signed integer type.
26
28Kernel Hackers Manual 3.10 June 2019 CLAMP_VAL(9)