lkml.org 
[lkml]   [2015]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectlinux-4.2-rc6/drivers/extcon/extcon.c: 3 * bad tests ?
Date
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


\
 
 \ /
  Last update: 2015-08-10 00:01    [W:0.120 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site