Re: [PATCH 4/4] gpiolib: cdev: replace locking wrappers for gpio_device with guards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(+PeterZ)

On Wed, Dec 20, 2023 at 2:52 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:

> Replace the wrapping functions that inhibit removal of the gpio_device
> with equivalent guard macros.
>
> Signed-off-by: Kent Gibson <warthog618@xxxxxxxxx>
(...)
> +DEFINE_CLASS(_read_sem_guard,
> +            struct rw_semaphore *,
> +            up_read(_T),
> +            ({
> +               down_read(sem);
> +               sem;
> +            }),
> +            struct rw_semaphore *sem);

Isn't this so generic that it should be in <linux/cleanup.h>?

Otherwise all the patches look good to me.

Yours,
Linus Walleij





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux