regulator: core: Make regulator_lock_two() logic easier to follow
authorDouglas Anderson <dianders@chromium.org>
Fri, 14 Apr 2023 00:34:17 +0000 (17:34 -0700)
committerMark Brown <broonie@kernel.org>
Tue, 18 Apr 2023 13:02:31 +0000 (14:02 +0100)
commit37473397b852f556d8b9428ccbfd51886037842d
treec9a200937ddc1e3925396fd461ac65d96c1d3028
parent902f8c9830c35cc61a7b3f63003c7246b2bf06ca
regulator: core: Make regulator_lock_two() logic easier to follow

The regulator_lock_two() function could be made clearer in the case of
lock contention by having a local variable for each of the held and
contended locks. Let's do that. At the same time, let's use the swap()
function instead of open coding it.

This change is expected to be a no-op and simply improves code
clarity.

Suggested-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/CAE-0n53Eb1BeDPmjBycXUaQAF4ppiAM6UDWje_jiB9GAmR8MMw@mail.gmail.com
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230413173359.1.I1ae92b25689bd6579952e6d458b79f5f8054a0c9@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c