Skip to content

Commit

Permalink
cfg80211: remove switch from __regulatory_hint()
Browse files Browse the repository at this point in the history
We have complete control over REGDOM_SET_BY_* enum passed
down to __regulatory_hint() as such there is no need to
account for unexpected REGDOM_SET_BY_*'s, lets just remove
the switch statement as this code does not change and
won't change even when we add 802.11d support.

This patch has no functional changes.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Nov 25, 2008
1 parent 91e9900 commit 5203cdb
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,34 +698,25 @@ int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
else if (r)
return r;

switch (set_by) {
case REGDOM_SET_BY_CORE:
case REGDOM_SET_BY_COUNTRY_IE:
case REGDOM_SET_BY_DRIVER:
case REGDOM_SET_BY_USER:
request = kzalloc(sizeof(struct regulatory_request),
GFP_KERNEL);
if (!request)
return -ENOMEM;

request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = set_by;
request->wiphy = wiphy;
request->intersect = intersect;

kfree(last_request);
last_request = request;
r = call_crda(alpha2);
request = kzalloc(sizeof(struct regulatory_request),
GFP_KERNEL);
if (!request)
return -ENOMEM;

request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = set_by;
request->wiphy = wiphy;
request->intersect = intersect;

kfree(last_request);
last_request = request;
r = call_crda(alpha2);

#ifndef CONFIG_WIRELESS_OLD_REGULATORY
if (r)
printk(KERN_ERR "cfg80211: Failed calling CRDA\n");
if (r)
printk(KERN_ERR "cfg80211: Failed calling CRDA\n");
#endif
break;
default:
r = -ENOTSUPP;
break;
}

return r;
}
Expand Down

0 comments on commit 5203cdb

Please sign in to comment.