2022-11-16 05:41:20

by Matti Vaittinen

[permalink] [raw]
Subject: [PATCH RESEND] 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 <[email protected]>
---
As unrelated side-note:
It slightly bugs me that the regulator framework duplicates this
initialization macro as it was originally left there. Would it be worth
the hassle to mass-convert users of REGULATOR_LINEAR_RANGE() to use the
LINEAR_RANGE() and remove the original macro?

lib/test_linear_ranges.c | 13 ++-----------
1 file 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)

base-commit: 094226ad94f471a9f19e8f8e7140a09c2625abaa
--
2.38.1


--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =]


Attachments:
(No filename) (1.87 kB)
signature.asc (499.00 B)
Download all attachments

2022-11-16 15:30:17

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH RESEND] lib/test_linear_ranges: Use LINEAR_RANGE()

On Wed, 16 Nov 2022 07:32:12 +0200, Matti Vaittinen wrote:
> 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.
>
> [...]

Applied to

broonie/regulator.git for-next

Thanks!

[1/1] lib/test_linear_ranges: Use LINEAR_RANGE()
commit: bc64f30eb9a5edb299ee0a1a05cc21e4079fd9f3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark