Re: [PATCH] gpio: sim: add lockdep asserts

From: Bartosz Golaszewski
Date: Fri Feb 23 2024 - 03:53:34 EST


On Wed, Feb 14, 2024 at 11:45 AM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> We have three functions in gpio-sim that are called with the device lock
> already held. We use the "_unlocked" suffix in their names to indicate
> that. This has proven to be confusing though as the naming convention in
> the kernel varies between using "_locked" or "_unlocked" for this
> purpose. Naming convention also doesn't enforce anything. Let's remove
> the suffix and add lockdep annotation at the top of these functions.
>
> This makes it clear the function requires a lock to be held (and which
> one specifically!) as well as results in a warning if it's not the case.
> The only place where the information is lost is the place where the
> function is called but the caller doesn't care about that information
> anyway.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> ---

Patch queued for next.

Bart