Re: [PATCH v2] gpiolib: cdev: document that line eflags are shared

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

 



On Wed, Oct 14, 2020 at 12:21 PM Kent Gibson <warthog618@xxxxxxxxx> wrote:
>
> The line.eflags field is shared so document this fact and highlight it
> throughout using READ_ONCE() and WRITE_ONCE() accessors.
>
> Also use a local copy of the eflags in edge_irq_thread() to ensure
> consistent control flow even if eflags changes.  This is only a defensive
> measure as edge_irq_thread() is currently disabled when the eflags are
> changed.

> -       if (line->eflags == (GPIO_V2_LINE_FLAG_EDGE_RISING |
> -                            GPIO_V2_LINE_FLAG_EDGE_FALLING)) {
> +       eflags = READ_ONCE(line->eflags);
> +       if (eflags == (GPIO_V2_LINE_FLAG_EDGE_RISING |
> +                      GPIO_V2_LINE_FLAG_EDGE_FALLING)) {

Hmm... side note: perhaps at some point

#define GPIO_V2_LINE_FLAG_EDGE_BOTH  \
        (GPIO_V2_LINE_FLAG_EDGE_RISING | GPIO_V2_LINE_FLAG_EDGE_FALLING)

       if (eflags == GPIO_V2_LINE_FLAG_EDGE_BOTH) {

?

-- 
With Best Regards,
Andy Shevchenko



[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