staging: rtl8188eu: removes comparison to null
authorJuliana Rodrigues <juliana.orod@gmail.com>
Sat, 27 May 2017 01:02:03 +0000 (22:02 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 May 2017 14:59:32 +0000 (16:59 +0200)
This patch fixes multiple comparison to NULL checkpatch errors by
rewriting the conditional as a negation.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_cmd.c

index e70086e1a2b16b6f69c4073942ec1e4922eb434a..002d09159896e63e1d2c54b1fb47efa2766197d9 100644 (file)
@@ -47,7 +47,7 @@ static int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
 {
        unsigned long irqL;
 
-       if (obj == NULL)
+       if (!obj)
                goto exit;
 
        spin_lock_irqsave(&queue->lock, irqL);
@@ -104,7 +104,7 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
        int res = _FAIL;
        struct adapter *padapter = pcmdpriv->padapter;
 
-       if (cmd_obj == NULL)
+       if (!cmd_obj)
                goto exit;
 
        cmd_obj->padapter = padapter;
@@ -132,7 +132,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
                kfree(pcmd->parmbuf);
        }
 
-       if (pcmd->rsp != NULL) {
+       if (!pcmd->rsp) {
                if (pcmd->rspsz != 0) {
                        /* free rsp in cmd_obj */
                        kfree(pcmd->rsp);
@@ -202,7 +202,7 @@ _next:
                /* call callback function for post-processed */
                if (pcmd->cmdcode < ARRAY_SIZE(rtw_cmd_callback)) {
                        pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
-                       if (pcmd_callback == NULL) {
+                       if (!pcmd_callback) {
                                RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("mlme_cmd_hdl(): pcmd_callback = 0x%p, cmdcode = 0x%x\n", pcmd_callback, pcmd->cmdcode));
                                rtw_free_cmd_obj(pcmd);
                        } else {
@@ -400,7 +400,7 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
        }
 
        psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss;
-       if (psecnetwork == NULL) {
+       if (!psecnetwork) {
                kfree(pcmd);
 
                res = _FAIL;
@@ -1214,7 +1214,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
                psta = rtw_get_stainfo(&padapter->stapriv, pnetwork->MacAddress);
                if (!psta) {
                        psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
-                       if (psta == NULL) {
+                       if (!psta) {
                                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nCan't alloc sta_info when createbss_cmd_callback\n"));
                                goto createbss_cmd_fail;
                        }
@@ -1224,9 +1224,9 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
        } else {
                pwlan = _rtw_alloc_network(pmlmepriv);
                spin_lock_bh(&pmlmepriv->scanned_queue.lock);
-               if (pwlan == NULL) {
+               if (!pwlan) {
                        pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue);
-                       if (pwlan == NULL) {
+                       if (!pwlan) {
                                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n Error:  can't get pwlan in rtw_joinbss_event_callback\n"));
                                spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
                                goto createbss_cmd_fail;
@@ -1263,7 +1263,7 @@ void rtw_setstaKey_cmdrsp_callback(struct adapter *padapter,  struct cmd_obj *pc
        struct set_stakey_rsp *psetstakey_rsp = (struct set_stakey_rsp *)(pcmd->rsp);
        struct sta_info *psta = rtw_get_stainfo(pstapriv, psetstakey_rsp->addr);
 
-       if (psta == NULL) {
+       if (!psta) {
                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: %s => can't get sta_info\n\n", __func__));
                goto exit;
        }
@@ -1279,7 +1279,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter,  struct cmd_obj *
        struct set_assocsta_rsp *passocsta_rsp = (struct set_assocsta_rsp *)(pcmd->rsp);
        struct sta_info *psta = rtw_get_stainfo(pstapriv, passocsta_parm->addr);
 
-       if (psta == NULL) {
+       if (!psta) {
                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: %s => can't get sta_info\n\n", __func__));
                goto exit;
        }