Commit 1a919318 authored by Johannes Berg's avatar Johannes Berg

regulatory: code cleanup

Clean up various things like indentation, extra
parentheses, too many/few line breaks, etc.
Acked-by: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 75e2dba8
...@@ -4259,7 +4259,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info) ...@@ -4259,7 +4259,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
dfs_region = nla_get_u8(info->attrs[NL80211_ATTR_DFS_REGION]); dfs_region = nla_get_u8(info->attrs[NL80211_ATTR_DFS_REGION]);
nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES], nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES],
rem_reg_rules) { rem_reg_rules) {
num_rules++; num_rules++;
if (num_rules > NL80211_MAX_SUPP_REG_RULES) if (num_rules > NL80211_MAX_SUPP_REG_RULES)
return -EINVAL; return -EINVAL;
...@@ -4273,7 +4273,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info) ...@@ -4273,7 +4273,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
} }
size_of_regd = sizeof(struct ieee80211_regdomain) + size_of_regd = sizeof(struct ieee80211_regdomain) +
(num_rules * sizeof(struct ieee80211_reg_rule)); num_rules * sizeof(struct ieee80211_reg_rule);
rd = kzalloc(size_of_regd, GFP_KERNEL); rd = kzalloc(size_of_regd, GFP_KERNEL);
if (!rd) { if (!rd) {
...@@ -4293,10 +4293,10 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info) ...@@ -4293,10 +4293,10 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
rd->dfs_region = dfs_region; rd->dfs_region = dfs_region;
nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES], nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES],
rem_reg_rules) { rem_reg_rules) {
nla_parse(tb, NL80211_REG_RULE_ATTR_MAX, nla_parse(tb, NL80211_REG_RULE_ATTR_MAX,
nla_data(nl_reg_rule), nla_len(nl_reg_rule), nla_data(nl_reg_rule), nla_len(nl_reg_rule),
reg_rule_policy); reg_rule_policy);
r = parse_reg_rule(tb, &rd->reg_rules[rule_idx]); r = parse_reg_rule(tb, &rd->reg_rules[rule_idx]);
if (r) if (r)
goto bad_reg; goto bad_reg;
...@@ -4312,10 +4312,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info) ...@@ -4312,10 +4312,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
BUG_ON(rule_idx != num_rules); BUG_ON(rule_idx != num_rules);
r = set_regdom(rd); r = set_regdom(rd);
rd = NULL;
mutex_unlock(&cfg80211_mutex);
return r;
bad_reg: bad_reg:
mutex_unlock(&cfg80211_mutex); mutex_unlock(&cfg80211_mutex);
......
This diff is collapsed.
...@@ -55,8 +55,8 @@ bool reg_last_request_cell_base(void); ...@@ -55,8 +55,8 @@ bool reg_last_request_cell_base(void);
* set the wiphy->disable_beacon_hints to true. * set the wiphy->disable_beacon_hints to true.
*/ */
int regulatory_hint_found_beacon(struct wiphy *wiphy, int regulatory_hint_found_beacon(struct wiphy *wiphy,
struct ieee80211_channel *beacon_chan, struct ieee80211_channel *beacon_chan,
gfp_t gfp); gfp_t gfp);
/** /**
* regulatory_hint_11d - hints a country IE as a regulatory domain * regulatory_hint_11d - hints a country IE as a regulatory domain
......
...@@ -519,10 +519,8 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid, ...@@ -519,10 +519,8 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
* - country_ie + 2, the start of the country ie data, and * - country_ie + 2, the start of the country ie data, and
* - and country_ie[1] which is the IE length * - and country_ie[1] which is the IE length
*/ */
regulatory_hint_11d(wdev->wiphy, regulatory_hint_11d(wdev->wiphy, bss->channel->band,
bss->channel->band, country_ie + 2, country_ie[1]);
country_ie + 2,
country_ie[1]);
kfree(country_ie); kfree(country_ie);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment