Staging: rtl8188eu: core: rtw_mlme.c: Replace NULL comparision.
authorSanjana Sanikommu <sanjana99reddy99@gmail.com>
Mon, 18 Mar 2019 14:29:44 +0000 (19:59 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Mar 2019 17:53:17 +0000 (18:53 +0100)
Replace NULL comparison with '!' in the file rtw_mlme.c
Issue found by checkpatch.pl semantic patch results for rtw_mlme.c

CHECK:Comparision to NULL could be written "!candidate"

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_mlme.c

index ca0cf8a..2b5aaa9 100644 (file)
@@ -1438,7 +1438,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) {
                *candidate = competitor;
                updated = true;
        }