Skip to content

Commit

Permalink
nl80211: trivial: Remove redundant loop
Browse files Browse the repository at this point in the history
cfg80211_assign_cookie already checks & prevents a 0 from being
returned, so the explicit loop is unnecessary.

Signed-off-by: Denis Kenzior <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
denkenz authored and jmberg-intel committed Oct 11, 2019
1 parent 2ce113d commit 2fd351a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2fd351a

Please sign in to comment.