Re: gpio/gpiolib-acpi.c:559: pointless test ?

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

 



Patch 4de60970abf9f49737f51ec6e7a1e3bcf6d36742 introduced this code.
Either the type is wrong, or the test should not be performed.
Considering the return type of acpi_gpiochip_pin_to_gpio_offset and
the fact it can return -EINVAL, I would say it is the former.

Qipeng, can you post a fix if you agree with my analysis, giving David
credit with the Reported-by tag?

Thanks!

On Tue, Apr 7, 2015 at 7:27 PM, David Binderman <dcb314@xxxxxxxxxxx> wrote:
> Hello there,
>
> [linux-4.0-rc7/drivers/gpio/gpiolib-acpi.c:559]: (style) Checking if unsigned variable 'pin' is less than zero.
>
>         if (pin < 0) {
>
> but
>
>       unsigned pin = agpio->pin_table[i];
>
> Regards
>
> David Binderman
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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