Skip to content

Commit

Permalink
regulatory: clean up regdom_intersect
Browse files Browse the repository at this point in the history
As the dummy_rule (also renamed from irule) is only
used for output by the reg_rules_intersect() function
there's no need to clear it at all, remove that.

Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jan 3, 2013
1 parent 82f2085 commit 74f53cd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,7 @@ static struct ieee80211_regdomain *regdom_intersect(
struct ieee80211_reg_rule *intersected_rule;
struct ieee80211_regdomain *rd;
/* This is just a dummy holder to help us count */
struct ieee80211_reg_rule irule;

/* Uses the stack temporarily for counter arithmetic */
intersected_rule = &irule;

memset(intersected_rule, 0, sizeof(struct ieee80211_reg_rule));
struct ieee80211_reg_rule dummy_rule;

if (!rd1 || !rd2)
return NULL;
Expand All @@ -630,11 +625,8 @@ static struct ieee80211_regdomain *regdom_intersect(
rule1 = &rd1->reg_rules[x];
for (y = 0; y < rd2->n_reg_rules; y++) {
rule2 = &rd2->reg_rules[y];
if (!reg_rules_intersect(rule1, rule2,
intersected_rule))
if (!reg_rules_intersect(rule1, rule2, &dummy_rule))
num_rules++;
memset(intersected_rule, 0,
sizeof(struct ieee80211_reg_rule));
}
}

Expand Down

0 comments on commit 74f53cd

Please sign in to comment.