diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-03 12:23:37 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:23 -0500 |
commit | f41737669d2f4c07c09e90767498243e142171f9 (patch) | |
tree | 2ac531e5ec1ffefe17f4bb81b0d8d420e48f9499 /net/wireless/reg.c | |
parent | 2f92212b71f198d42060f7133ff1dc4edf438f6c (diff) |
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.c | 14 |
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, | |||
1539 | 1539 | ||
1540 | BUG_ON(!reg_request->alpha2); | 1540 | BUG_ON(!reg_request->alpha2); |
1541 | 1541 | ||
1542 | if (wiphy_idx_valid(reg_request->wiphy_idx)) | 1542 | if (reg_request->wiphy_idx != WIPHY_IDX_INVALID) |
1543 | wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); | 1543 | wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); |
1544 | 1544 | ||
1545 | if (reg_initiator == NL80211_REGDOM_SET_BY_DRIVER && !wiphy) { | 1545 | if (reg_initiator == NL80211_REGDOM_SET_BY_DRIVER && !wiphy) { |
@@ -1684,7 +1684,7 @@ int regulatory_hint_user(const char *alpha2, | |||
1684 | if (!request) | 1684 | if (!request) |
1685 | return -ENOMEM; | 1685 | return -ENOMEM; |
1686 | 1686 | ||
1687 | request->wiphy_idx = WIPHY_IDX_STALE; | 1687 | request->wiphy_idx = WIPHY_IDX_INVALID; |
1688 | request->alpha2[0] = alpha2[0]; | 1688 | request->alpha2[0] = alpha2[0]; |
1689 | request->alpha2[1] = alpha2[1]; | 1689 | request->alpha2[1] = alpha2[1]; |
1690 | request->initiator = NL80211_REGDOM_SET_BY_USER; | 1690 | request->initiator = NL80211_REGDOM_SET_BY_USER; |
@@ -1709,9 +1709,6 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2) | |||
1709 | 1709 | ||
1710 | request->wiphy_idx = get_wiphy_idx(wiphy); | 1710 | request->wiphy_idx = get_wiphy_idx(wiphy); |
1711 | 1711 | ||
1712 | /* Must have registered wiphy first */ | ||
1713 | BUG_ON(!wiphy_idx_valid(request->wiphy_idx)); | ||
1714 | |||
1715 | request->alpha2[0] = alpha2[0]; | 1712 | request->alpha2[0] = alpha2[0]; |
1716 | request->alpha2[1] = alpha2[1]; | 1713 | request->alpha2[1] = alpha2[1]; |
1717 | request->initiator = NL80211_REGDOM_SET_BY_DRIVER; | 1714 | request->initiator = NL80211_REGDOM_SET_BY_DRIVER; |
@@ -1758,9 +1755,8 @@ void regulatory_hint_11d(struct wiphy *wiphy, enum ieee80211_band band, | |||
1758 | * We leave conflict resolution to the workqueue, where can hold | 1755 | * We leave conflict resolution to the workqueue, where can hold |
1759 | * cfg80211_mutex. | 1756 | * cfg80211_mutex. |
1760 | */ | 1757 | */ |
1761 | if (likely(last_request->initiator == | 1758 | if (last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE && |
1762 | NL80211_REGDOM_SET_BY_COUNTRY_IE && | 1759 | last_request->wiphy_idx != WIPHY_IDX_INVALID) |
1763 | wiphy_idx_valid(last_request->wiphy_idx))) | ||
1764 | goto out; | 1760 | goto out; |
1765 | 1761 | ||
1766 | request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); | 1762 | request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); |
@@ -2317,7 +2313,7 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy) | |||
2317 | if (!request_wiphy || request_wiphy != wiphy) | 2313 | if (!request_wiphy || request_wiphy != wiphy) |
2318 | goto out; | 2314 | goto out; |
2319 | 2315 | ||
2320 | last_request->wiphy_idx = WIPHY_IDX_STALE; | 2316 | last_request->wiphy_idx = WIPHY_IDX_INVALID; |
2321 | last_request->country_ie_env = ENVIRON_ANY; | 2317 | last_request->country_ie_env = ENVIRON_ANY; |
2322 | out: | 2318 | out: |
2323 | mutex_unlock(®_mutex); | 2319 | mutex_unlock(®_mutex); |