Subject: Re: [PATCH] staging: rtl8188eu: style fixes

From: Galo <[email-masked]>
Date: Sun, 23 Apr 2017 21:00:47 +0200

On 21-04, Stephen Rothwell wrote:
> Hi Galo,
> 
> On Fri, 21 Apr 2017 10:06:25 +0200 Galo <[email-masked]> wrote:
> >
> > @@ -1461,7 +1460,7 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv
> >  			goto exit;
> >  	}
> >  
> > -	if (*candidate == NULL || (*candidate)->network.Rssi < competitor->network.Rssi) {
> > +	if (!candidate || (*candidate)->network.Rssi < competitor->network.Rssi) {
> 
> These are not equivalent.  It should be "!*candidate"
> 
> -- 
> Cheers,
> Stephen Rothwell
> 

Thanks a lot for catching this.  I blindly copied from the checkpatch
suggestion, which is indeed wrong:

    CHECK: Comparison to NULL could be written "!candidate"
    #216: FILE: drivers/staging/rtl8188eu/core/rtw_mlme.c:1463:
    +       if (*candidate == NULL || (*candidate)->network.Rssi <
    competitor->network.Rssi)  {}

Fixing this in a new version of the patch, I'll report the issue in
checkpatch separately.

Galo