Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib: add linear range index macro

Add linear_range_idx macro for declaring the linear_range struct simply.

Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: ChiaEn Wu <chiaen_wu@richtek.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

ChiaEn Wu and committed by
Sebastian Reichel
c2f2e2c3 568035b0

+11
+11
include/linux/linear_range.h
··· 26 26 unsigned int step; 27 27 }; 28 28 29 + #define LINEAR_RANGE(_min, _min_sel, _max_sel, _step) \ 30 + { \ 31 + .min = _min, \ 32 + .min_sel = _min_sel, \ 33 + .max_sel = _max_sel, \ 34 + .step = _step, \ 35 + } 36 + 37 + #define LINEAR_RANGE_IDX(_idx, _min, _min_sel, _max_sel, _step) \ 38 + [_idx] = LINEAR_RANGE(_min, _min_sel, _max_sel, _step) 39 + 29 40 unsigned int linear_range_values_in_range(const struct linear_range *r); 30 41 unsigned int linear_range_values_in_range_array(const struct linear_range *r, 31 42 int ranges);