Commit 11975c56 authored by Sandhya Bankar's avatar Sandhya Bankar Committed by Greg Kroah-Hartman
Browse files

Staging: rtl8712: rtl871x_cmd: Use !x instead of x == NULL.



Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: default avatarSandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78f70e6d
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -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);