summaryrefslogtreecommitdiff
path: root/lib/test_linear_ranges.c
diff options
context:
space:
mode:
authorMatti Vaittinen <mazziesaccount@gmail.com>2022-11-16 07:32:12 +0200
committerMark Brown <broonie@kernel.org>2022-11-16 13:32:32 +0000
commitbc64f30eb9a5edb299ee0a1a05cc21e4079fd9f3 (patch)
tree20e9f97ba116e30e4583d2e5dde83469cce0f03a /lib/test_linear_ranges.c
parentb8dfb3bed5524589052dafa0e4d6c4e25ae11544 (diff)
lib/test_linear_ranges: Use LINEAR_RANGE()
New initialization macro for linear ranges was added. Slightly simplify the test code by using this macro - and at the same time also verify the macro is working as intended. Use the newly added LINEAR_RANGE() initialization macro for linear range test. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/Y3R13IRrs+x5PcZ4@dc75zzyyyyyyyyyyyyydt-3.rev.dnainternet.fi Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'lib/test_linear_ranges.c')
-rw-r--r--lib/test_linear_ranges.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/test_linear_ranges.c b/lib/test_linear_ranges.c
index 676e0b8abcdd..c18f9c0f1f25 100644
--- a/lib/test_linear_ranges.c
+++ b/lib/test_linear_ranges.c
@@ -107,17 +107,8 @@ static const unsigned int range2_vals[] = { RANGE2_MIN, RANGE2_MIN +
#define SMALLEST_VAL RANGE1_MIN
static struct linear_range testr[] = {
- {
- .min = RANGE1_MIN,
- .min_sel = RANGE1_MIN_SEL,
- .max_sel = RANGE1_MAX_SEL,
- .step = RANGE1_STEP,
- }, {
- .min = RANGE2_MIN,
- .min_sel = RANGE2_MIN_SEL,
- .max_sel = RANGE2_MAX_SEL,
- .step = RANGE2_STEP
- },
+ LINEAR_RANGE(RANGE1_MIN, RANGE1_MIN_SEL, RANGE1_MAX_SEL, RANGE1_STEP),
+ LINEAR_RANGE(RANGE2_MIN, RANGE2_MIN_SEL, RANGE2_MAX_SEL, RANGE2_STEP),
};
static void range_test_get_value(struct kunit *test)