From 58ff7e7aaa513a3aad257d2a083586f3b3fdb6df Mon Sep 17 00:00:00 2001 From: Payal Kshirsagar Date: Tue, 2 Apr 2019 20:54:13 +0530 Subject: [PATCH] staging: rtl8712: rtl871x_mlme.c: use !x in place of NULL comparison Challenge suggested by coccinelle. Avoid NULL comparison, compare using boolean operator. Signed-off-by: Payal Kshirsagar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl871x_mlme.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index c666e03..e370841 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -95,7 +95,7 @@ static void _free_network(struct mlme_priv *pmlmepriv, unsigned long irqL; struct __queue *free_queue = &(pmlmepriv->free_bss_pool); - if (pnetwork == NULL) + if (!pnetwork) return; if (pnetwork->fixed) return; @@ -115,7 +115,7 @@ static void free_network_nolock(struct mlme_priv *pmlmepriv, { struct __queue *free_queue = &pmlmepriv->free_bss_pool; - if (pnetwork == NULL) + if (!pnetwork) return; if (pnetwork->fixed) return; @@ -399,7 +399,7 @@ static void update_scanned_network(struct _adapter *adapter, /* Otherwise just pull from the free list */ /* update scan_time */ pnetwork = alloc_network(pmlmepriv); - if (pnetwork == NULL) + if (!pnetwork) return; bssid_ex_sz = r8712_get_wlan_bssid_ex_sz(target); target->Length = bssid_ex_sz; @@ -1120,7 +1120,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) } pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); - if (pnetwork == NULL) + if (!pnetwork) return _FAIL; pmlmepriv->pscanned = pmlmepriv->pscanned->next; if (pmlmepriv->assoc_by_bssid) { -- 2.7.4