Skip to contentSkip to conversation

drivers: staging: rtl8723au: remove unneeded null test

PATCH In review Cihangir Akturk 2 participants 2 messages Mar 4, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: staging: rtl8723au: remove unneeded null test

null test on pnetwork removed, because the iterator variable list_for_each_entry_safe cannot be null.

This commit fixes the following error reported by coccinelle:

drivers/staging/rtl8723au/core/rtw_mlme.c:1621:7-15: ERROR: iterator variable bound on line 1620 cannot be NULL

---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/staging/rtl8723au/core/rtw_mlme.c +2 -11
index 3adda55..a786fc4 100644
@@ -1617,19 +1617,10 @@ rtw_select_candidate_from_queue(struct mlme_priv *pmlmepriv)
 
 	spin_lock_bh(&pmlmepriv->scanned_queue.lock);
 	phead = get_list_head(queue);
-	list_for_each_entry_safe(pnetwork, ptmp, phead, list) {
-		if (!pnetwork) {
-			RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_,
-				 "%s: return _FAIL:(pnetwork == NULL)\n",
-				 __func__);
-			goto exit;
-		}
-
+	list_for_each_entry_safe(pnetwork, ptmp, phead, list)
 		rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
-	}
-
-exit:
 	spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
+
 	return candidate;
 }
 
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Cihangir Akturk

null test on pnetwork removed, because the iterator variable list_for_each_entry_safe cannot be null.

This commit fixes the following error reported by coccinelle:

Quoted 7 lines

drivers/staging/rtl8723au/core/rtw_mlme.c:1621:7-15: ERROR: iterator variable bound on line 1620 cannot be NULL

---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

Looks fine to me