Re: [PATCH v1] gpiolib: Optimize gpiochip_remove() when check for requested line

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

 



On Tue, Feb 25, 2020 at 12:47 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> Here are the following optimizations have been done:
>  - break the loop after first found requested line
>   - due to above, drop redundant boolean variable
>  - replace open coded variant of gpiochip_is_requested()
>   - due to above, drop redundant pointer to struct gpio_desc
>  - use 'unsigned int' instead of 'unsigned' for loop counter
>
> Note, pointer to struct gpio_chip followed by pointer to struct gpio_device
> is still valid, back link is not.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Looks neat!
Patch applied.

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