Re: [PATCH 1/6] regulator: core: simplify regulator_lock_nested()

From: Doug Anderson
Date: Mon Aug 21 2023 - 12:50:27 EST


Hi,

On Sat, Aug 19, 2023 at 3:46 PM Michał Mirosław <mirq-linux@xxxxxxxxxxxx> wrote:
>
> `lock` is only false when the `rdev` is already locked and the owner is
> `current`. In this case `ret` is always zero. By removing `lock`, we
> thus remove `mutex_owner` write avoidance, but make the code flow more
> understandable.
>
> Signed-off-by: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
> ---
> drivers/regulator/core.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)

Agreed that this looks to be equivalent and easier to understand.

Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>