linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: staging: rtl8723au: remove unneeded null test
@ 2016-03-04 13:43 Cihangir Akturk
  2016-03-04 19:15 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Cihangir Akturk @ 2016-03-04 13:43 UTC (permalink / raw)
  To: Larry.Finger, Jes.Sorensen; +Cc: gregkh, linux-wireless, devel, 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:

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

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 3adda55..a786fc4 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -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;
 }
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: staging: rtl8723au: remove unneeded null test
  2016-03-04 13:43 [PATCH] drivers: staging: rtl8723au: remove unneeded null test Cihangir Akturk
@ 2016-03-04 19:15 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2016-03-04 19:15 UTC (permalink / raw)
  To: Cihangir Akturk; +Cc: Larry.Finger, gregkh, linux-wireless, devel

Cihangir Akturk <cakturk@gmail.com> writes:
> 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
>
> Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
> ---
>  drivers/staging/rtl8723au/core/rtw_mlme.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)

Looks fine to me

Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-04 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-04 13:43 [PATCH] drivers: staging: rtl8723au: remove unneeded null test Cihangir Akturk
2016-03-04 19:15 ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).