summaryrefslogtreecommitdiff
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-12-03 18:23:37 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-01-03 13:01:23 +0100
commitf41737669d2f4c07c09e90767498243e142171f9 (patch)
tree2ac531e5ec1ffefe17f4bb81b0d8d420e48f9499 /net/wireless/reg.c
parent2f92212b71f198d42060f7133ff1dc4edf438f6c (diff)
downloadlinux-stable-f41737669d2f4c07c09e90767498243e142171f9.tar.gz
linux-stable-f41737669d2f4c07c09e90767498243e142171f9.tar.bz2
linux-stable-f41737669d2f4c07c09e90767498243e142171f9.zip
cfg80211: remove wiphy_idx_valid
This is pretty much useless since get_wiphy_idx() always returns true since it's always called with a valid wiphy pointer. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 129586994662..b825c82e5a45 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1539,7 +1539,7 @@ static void reg_process_hint(struct regulatory_request *reg_request,
BUG_ON(!reg_request->alpha2);
- if (wiphy_idx_valid(reg_request->wiphy_idx))
+ if (reg_request->wiphy_idx != WIPHY_IDX_INVALID)
wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx);
if (reg_initiator == NL80211_REGDOM_SET_BY_DRIVER && !wiphy) {
@@ -1684,7 +1684,7 @@ int regulatory_hint_user(const char *alpha2,
if (!request)
return -ENOMEM;
- request->wiphy_idx = WIPHY_IDX_STALE;
+ request->wiphy_idx = WIPHY_IDX_INVALID;
request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = NL80211_REGDOM_SET_BY_USER;
@@ -1709,9 +1709,6 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2)
request->wiphy_idx = get_wiphy_idx(wiphy);
- /* Must have registered wiphy first */
- BUG_ON(!wiphy_idx_valid(request->wiphy_idx));
-
request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = NL80211_REGDOM_SET_BY_DRIVER;
@@ -1758,9 +1755,8 @@ void regulatory_hint_11d(struct wiphy *wiphy, enum ieee80211_band band,
* We leave conflict resolution to the workqueue, where can hold
* cfg80211_mutex.
*/
- if (likely(last_request->initiator ==
- NL80211_REGDOM_SET_BY_COUNTRY_IE &&
- wiphy_idx_valid(last_request->wiphy_idx)))
+ if (last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
+ last_request->wiphy_idx != WIPHY_IDX_INVALID)
goto out;
request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
@@ -2317,7 +2313,7 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy)
if (!request_wiphy || request_wiphy != wiphy)
goto out;
- last_request->wiphy_idx = WIPHY_IDX_STALE;
+ last_request->wiphy_idx = WIPHY_IDX_INVALID;
last_request->country_ie_env = ENVIRON_ANY;
out:
mutex_unlock(&reg_mutex);