Staging: rtl8712: rtl871x_cmd: Use !x instead of x == NULL.
authorSandhya Bankar <bankarsandhya512@gmail.com>
Tue, 20 Sep 2016 09:07:43 +0000 (14:37 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2016 11:38:00 +0000 (13:38 +0200)
Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_cmd.c

index 51b6959..b7ee5e6 100644 (file)
@@ -66,13 +66,13 @@ static sint _init_cmd_priv(struct cmd_priv *pcmdpriv)
        pcmdpriv->cmd_seq = 1;
        pcmdpriv->cmd_allocated_buf = kmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ,
                                              GFP_ATOMIC);
-       if (pcmdpriv->cmd_allocated_buf == NULL)
+       if (!pcmdpriv->cmd_allocated_buf)
                return _FAIL;
        pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf  +  CMDBUFF_ALIGN_SZ -
                            ((addr_t)(pcmdpriv->cmd_allocated_buf) &
                            (CMDBUFF_ALIGN_SZ - 1));
        pcmdpriv->rsp_allocated_buf = kmalloc(MAX_RSPSZ + 4, GFP_ATOMIC);
-       if (pcmdpriv->rsp_allocated_buf == NULL)
+       if (!pcmdpriv->rsp_allocated_buf)
                return _FAIL;
        pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf  +  4 -
                            ((addr_t)(pcmdpriv->rsp_allocated_buf) & 3);
@@ -88,7 +88,7 @@ static sint _init_evt_priv(struct evt_priv *pevtpriv)
        pevtpriv->event_seq = 0;
        pevtpriv->evt_allocated_buf = kmalloc(MAX_EVTSZ + 4, GFP_ATOMIC);
 
-       if (pevtpriv->evt_allocated_buf == NULL)
+       if (!pevtpriv->evt_allocated_buf)
                return _FAIL;
        pevtpriv->evt_buf = pevtpriv->evt_allocated_buf  +  4 -
                            ((addr_t)(pevtpriv->evt_allocated_buf) & 3);
@@ -123,7 +123,7 @@ static sint _enqueue_cmd(struct  __queue *queue, struct cmd_obj *obj)
 {
        unsigned long irqL;
 
-       if (obj == NULL)
+       if (!obj)
                return _SUCCESS;
        spin_lock_irqsave(&queue->lock, irqL);
        list_add_tail(&obj->list, &queue->queue);
@@ -181,7 +181,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
        unsigned long irqL;
        struct  __queue *queue;
 
-       if (obj == NULL)
+       if (!obj)
                return _SUCCESS;
        if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
                return _FAIL;
@@ -477,7 +477,7 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
                }
        }
        psecnetwork = &psecuritypriv->sec_bss;
-       if (psecnetwork == NULL) {
+       if (!psecnetwork) {
                kfree(pcmd);
                return _FAIL;
        }
@@ -884,16 +884,16 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter,
                if (!psta) {
                        psta = r8712_alloc_stainfo(&padapter->stapriv,
                                                   pnetwork->MacAddress);
-                       if (psta == NULL)
+                       if (!psta)
                                goto createbss_cmd_fail;
                }
                r8712_indicate_connect(padapter);
        } else {
                pwlan = _r8712_alloc_network(pmlmepriv);
-               if (pwlan == NULL) {
+               if (!pwlan) {
                        pwlan = r8712_get_oldest_wlan_network(
                                &pmlmepriv->scanned_queue);
-                       if (pwlan == NULL)
+                       if (!pwlan)
                                goto createbss_cmd_fail;
                        pwlan->last_scanned = jiffies;
                } else
@@ -925,7 +925,7 @@ void r8712_setstaKey_cmdrsp_callback(struct _adapter *padapter,
        struct sta_info *psta = r8712_get_stainfo(pstapriv,
                                                  psetstakey_rsp->addr);
 
-       if (psta == NULL)
+       if (!psta)
                goto exit;
        psta->aid = psta->mac_id = psetstakey_rsp->keyid; /*CAM_ID(CAM_ENTRY)*/
 exit:
@@ -945,7 +945,7 @@ void r8712_setassocsta_cmdrsp_callback(struct _adapter *padapter,
        struct sta_info *psta = r8712_get_stainfo(pstapriv,
                                                  passocsta_parm->addr);
 
-       if (psta == NULL)
+       if (!psta)
                return;
        psta->aid = psta->mac_id = passocsta_rsp->cam_id;
        spin_lock_irqsave(&pmlmepriv->lock, irqL);