Hi Alex

Yes, the type is wrong and this is not show in function test without error case.
I will post fix for this.
Thanks.



Best wishes
Qipeng


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Alexandre Courbot
Sent: Thursday, April 09, 2015 9:56 AM
To: David Binderman; Zha, Qipeng; Mika Westerberg
Cc: Linus Walleij; [email protected]
Subject: Re: gpio/gpiolib-acpi.c:559: pointless test ?

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 <[email protected]> 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 [email protected] More majordomo info at  
http://vger.kernel.org/majordomo-info.html

Reply via email to