diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-02-12 05:29:32 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-02-12 05:29:32 -0500 |
commit | 1d5e1266cf4d96660e9b01577fdf8046b076cb58 (patch) | |
tree | 6335cf6b1a78d72676f1f8609878804f75c326c9 /net/mac80211 | |
parent | 361c3e0485c737b9c8a2d456b8c3c7b08d8ca8ee (diff) |
mac80211: simplify roc check in idle calculation
There's no need to start iterating the list only to break on the
first item, just use !list_empty() and also simplify the whole
conditional into a single expression.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/iface.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 8880bc8fce0d..9db71cf7a665 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -101,9 +101,8 @@ static u32 __ieee80211_idle_on(struct ieee80211_local *local) | |||
101 | static u32 __ieee80211_recalc_idle(struct ieee80211_local *local, | 101 | static u32 __ieee80211_recalc_idle(struct ieee80211_local *local, |
102 | bool force_active) | 102 | bool force_active) |
103 | { | 103 | { |
104 | bool working = false, scanning, active; | 104 | bool working, scanning, active; |
105 | unsigned int led_trig_start = 0, led_trig_stop = 0; | 105 | unsigned int led_trig_start = 0, led_trig_stop = 0; |
106 | struct ieee80211_roc_work *roc; | ||
107 | 106 | ||
108 | lockdep_assert_held(&local->mtx); | 107 | lockdep_assert_held(&local->mtx); |
109 | 108 | ||
@@ -111,12 +110,8 @@ static u32 __ieee80211_recalc_idle(struct ieee80211_local *local, | |||
111 | !list_empty(&local->chanctx_list) || | 110 | !list_empty(&local->chanctx_list) || |
112 | local->monitors; | 111 | local->monitors; |
113 | 112 | ||
114 | if (!local->ops->remain_on_channel) { | 113 | working = !local->ops->remain_on_channel && |
115 | list_for_each_entry(roc, &local->roc_list, list) { | 114 | !list_empty(&local->roc_list); |
116 | working = true; | ||
117 | break; | ||
118 | } | ||
119 | } | ||
120 | 115 | ||
121 | scanning = test_bit(SCAN_SW_SCANNING, &local->scanning) || | 116 | scanning = test_bit(SCAN_SW_SCANNING, &local->scanning) || |
122 | test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning); | 117 | test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning); |