All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-4.2-rc6/drivers/extcon/extcon.c: 3 * bad tests ?
@ 2015-08-09 21:30 David Binderman
  2015-08-10  1:12 ` Chanwoo Choi
  0 siblings, 1 reply; 2+ messages in thread
From: David Binderman @ 2015-08-09 21:30 UTC (permalink / raw)
  To: myungjoo.ham, cw00.choi, linux-kernel

Hello there,

1.

[linux-4.2-rc6/drivers/extcon/extcon.c:153]: (style) Checking if unsigned variable 'id' is less than zero.

Source code is

    id = find_cable_id_by_name(edev, name);
    if (id < 0)

but

   unsigned int id;

Suggest sanity check return value from find_cable_id_by_name
*before* assigning it into an unsigned variable.

2.

[linux-4.2-rc6/drivers/extcon/extcon.c:384]: (style) Checking if unsigned variable 'id' is less than zero.

Duplicate.

3.

[linux-4.2-rc6/drivers/extcon/extcon.c:432]: (style) Checking if unsigned variable 'id' is less than zero.

Another duplicate.


Regards

David Binderman
 		 	   		  

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: linux-4.2-rc6/drivers/extcon/extcon.c: 3 * bad tests ?
  2015-08-09 21:30 linux-4.2-rc6/drivers/extcon/extcon.c: 3 * bad tests ? David Binderman
@ 2015-08-10  1:12 ` Chanwoo Choi
  0 siblings, 0 replies; 2+ messages in thread
From: Chanwoo Choi @ 2015-08-10  1:12 UTC (permalink / raw)
  To: David Binderman; +Cc: myungjoo.ham, linux-kernel

Hi David,

I knew this issue. So, I'll send following patch[1] to solve it for Linux 4.3
[1] http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-next&id=4e491fe7920cb84dd0a2ea79800173ab1802fa22

Thanks,
Chanwoo Choi

On 08/10/2015 06:30 AM, David Binderman wrote:
> Hello there,
> 
> 1.
> 
> [linux-4.2-rc6/drivers/extcon/extcon.c:153]: (style) Checking if unsigned variable 'id' is less than zero.
> 
> Source code is
> 
>     id = find_cable_id_by_name(edev, name);
>     if (id < 0)
> 
> but
> 
>    unsigned int id;
> 
> Suggest sanity check return value from find_cable_id_by_name
> *before* assigning it into an unsigned variable.
> 
> 2.
> 
> [linux-4.2-rc6/drivers/extcon/extcon.c:384]: (style) Checking if unsigned variable 'id' is less than zero.
> 
> Duplicate.
> 
> 3.
> 
> [linux-4.2-rc6/drivers/extcon/extcon.c:432]: (style) Checking if unsigned variable 'id' is less than zero.
> 
> Another duplicate.
> 
> 
> Regards
> 
> David Binderman
>  		 	   		  
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-10  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-09 21:30 linux-4.2-rc6/drivers/extcon/extcon.c: 3 * bad tests ? David Binderman
2015-08-10  1:12 ` Chanwoo Choi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.