Skip to contentSkip to conversation

nl80211: trivial: Remove redundant loop

PATCH New Denis Kenzior 1 participant 1 message Oct 8, 2019 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nl80211: trivial: Remove redundant loop

cfg80211_assign_cookie already checks & prevents a 0 from being returned, so the explicit loop is unnecessary.

---
 net/wireless/nl80211.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/wireless/nl80211.c +2 -4
index d21b1581a665..57bade7ea41c 100644
@@ -8227,10 +8227,8 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
 	/* leave request id zero for legacy request
 	 * or if driver does not support multi-scheduled scan
 	 */
-	if (want_multi && rdev->wiphy.max_sched_scan_reqs > 1) {
-		while (!sched_scan_req->reqid)
-			sched_scan_req->reqid = cfg80211_assign_cookie(rdev);
-	}
+	if (want_multi && rdev->wiphy.max_sched_scan_reqs > 1)
+		sched_scan_req->reqid = cfg80211_assign_cookie(rdev);
 
 	err = rdev_sched_scan_start(rdev, dev, sched_scan_req);
 	if (err)
Signature · 1 line
2.21.0