2015-07-07 11:24:28

by David Binderman

[permalink] [raw]
Subject: linux-4.2-rc1/drivers/staging/wilc1000/linux_wlan.c:1874: bad test ?

Hello there,

[linux-4.2-rc1/drivers/staging/wilc1000/linux_wlan.c:1874]: (style) A pointer can not be negative so it is either pointless or an error to check if it is.

Source code is

???? if (wilc_mac_thread < 0) {

but

struct task_struct *wilc_mac_thread;

Regards

David Binderman



2015-07-08 00:56:46

by Johnny Kim

[permalink] [raw]
Subject: RE: linux-4.2-rc1/drivers/staging/wilc1000/linux_wlan.c:1874: bad test ?

Hello David.

Thanks for your detail review.
The code is wrong and will be removed because of unused code later.

Regards.
Johnny.

-----Original Message-----
From: David Binderman [mailto:[email protected]]
Sent: Tuesday, July 07, 2015 8:19 PM
To: Kim, Johnny; Kim, Rachel; Lee, Dean; Park, Chris; [email protected]
Subject: linux-4.2-rc1/drivers/staging/wilc1000/linux_wlan.c:1874: bad test ?

Hello there,

[linux-4.2-rc1/drivers/staging/wilc1000/linux_wlan.c:1874]: (style) A pointer can not be negative so it is either pointless or an error to check if it is.

Source code is

???? if (wilc_mac_thread < 0) {

but

struct task_struct *wilc_mac_thread;

Regards

David Binderman



2015-07-07 17:22:14

by Randy Dunlap

[permalink] [raw]
Subject: Re: linux-4.2-rc1/drivers/staging/wilc1000/linux_wlan.c:1874: bad test ?

On 07/07/15 04:19, David Binderman wrote:
> Hello there,
>
> [linux-4.2-rc1/drivers/staging/wilc1000/linux_wlan.c:1874]: (style) A pointer can not be negative so it is either pointless or an error to check if it is.
>
> Source code is
>
> if (wilc_mac_thread < 0) {
>
> but
>
> struct task_struct *wilc_mac_thread;


#include <linux/err.h>


if (IS_ERR(wilc_mac_thread)) {


--
~Randy