1 --- a/net/mac80211/mesh_pathtbl.c
2 +++ b/net/mac80211/mesh_pathtbl.c
3 @@ -72,9 +72,9 @@ static inline struct mesh_table *resize_
4 * it's used twice. So it is illegal to do
5 * for_each_mesh_entry(rcu_dereference(...), ...)
7 -#define for_each_mesh_entry(tbl, p, node, i) \
8 +#define for_each_mesh_entry(tbl, node, i) \
9 for (i = 0; i <= tbl->hash_mask; i++) \
10 - hlist_for_each_entry_rcu(node, p, &tbl->hash_buckets[i], list)
11 + hlist_for_each_entry_rcu(node, &tbl->hash_buckets[i], list)
14 static struct mesh_table *mesh_table_alloc(int size_order)
15 @@ -139,7 +139,7 @@ static void mesh_table_free(struct mesh_
18 spin_lock_bh(&tbl->gates_lock);
19 - hlist_for_each_entry_safe(gate, p, q,
20 + hlist_for_each_entry_safe(gate, q,
21 tbl->known_gates, list) {
22 hlist_del(&gate->list);
24 @@ -333,12 +333,11 @@ static struct mesh_path *mpath_lookup(st
25 struct ieee80211_sub_if_data *sdata)
27 struct mesh_path *mpath;
28 - struct hlist_node *n;
29 struct hlist_head *bucket;
30 struct mpath_node *node;
32 bucket = &tbl->hash_buckets[mesh_table_hash(dst, sdata, tbl)];
33 - hlist_for_each_entry_rcu(node, n, bucket, list) {
34 + hlist_for_each_entry_rcu(node, bucket, list) {
36 if (mpath->sdata == sdata &&
37 ether_addr_equal(dst, mpath->dst)) {
38 @@ -389,11 +388,10 @@ mesh_path_lookup_by_idx(struct ieee80211
40 struct mesh_table *tbl = rcu_dereference(mesh_paths);
41 struct mpath_node *node;
42 - struct hlist_node *p;
46 - for_each_mesh_entry(tbl, p, node, i) {
47 + for_each_mesh_entry(tbl, node, i) {
48 if (sdata && node->mpath->sdata != sdata)
51 @@ -417,13 +415,12 @@ int mesh_path_add_gate(struct mesh_path
53 struct mesh_table *tbl;
54 struct mpath_node *gate, *new_gate;
55 - struct hlist_node *n;
59 tbl = rcu_dereference(mesh_paths);
61 - hlist_for_each_entry_rcu(gate, n, tbl->known_gates, list)
62 + hlist_for_each_entry_rcu(gate, tbl->known_gates, list)
63 if (gate->mpath == mpath) {
66 @@ -460,9 +457,9 @@ err_rcu:
67 static void mesh_gate_del(struct mesh_table *tbl, struct mesh_path *mpath)
69 struct mpath_node *gate;
70 - struct hlist_node *p, *q;
71 + struct hlist_node *q;
73 - hlist_for_each_entry_safe(gate, p, q, tbl->known_gates, list) {
74 + hlist_for_each_entry_safe(gate, q, tbl->known_gates, list) {
75 if (gate->mpath != mpath)
77 spin_lock_bh(&tbl->gates_lock);
78 @@ -504,7 +501,6 @@ int mesh_path_add(struct ieee80211_sub_i
79 struct mesh_path *mpath, *new_mpath;
80 struct mpath_node *node, *new_node;
81 struct hlist_head *bucket;
82 - struct hlist_node *n;
86 @@ -550,7 +546,7 @@ int mesh_path_add(struct ieee80211_sub_i
87 spin_lock(&tbl->hashwlock[hash_idx]);
90 - hlist_for_each_entry(node, n, bucket, list) {
91 + hlist_for_each_entry(node, bucket, list) {
93 if (mpath->sdata == sdata &&
94 ether_addr_equal(dst, mpath->dst))
95 @@ -640,7 +636,6 @@ int mpp_path_add(struct ieee80211_sub_if
96 struct mesh_path *mpath, *new_mpath;
97 struct mpath_node *node, *new_node;
98 struct hlist_head *bucket;
99 - struct hlist_node *n;
103 @@ -680,7 +675,7 @@ int mpp_path_add(struct ieee80211_sub_if
104 spin_lock(&tbl->hashwlock[hash_idx]);
107 - hlist_for_each_entry(node, n, bucket, list) {
108 + hlist_for_each_entry(node, bucket, list) {
110 if (mpath->sdata == sdata &&
111 ether_addr_equal(dst, mpath->dst))
112 @@ -725,14 +720,13 @@ void mesh_plink_broken(struct sta_info *
113 static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
114 struct mesh_path *mpath;
115 struct mpath_node *node;
116 - struct hlist_node *p;
117 struct ieee80211_sub_if_data *sdata = sta->sdata;
119 __le16 reason = cpu_to_le16(WLAN_REASON_MESH_PATH_DEST_UNREACHABLE);
122 tbl = rcu_dereference(mesh_paths);
123 - for_each_mesh_entry(tbl, p, node, i) {
124 + for_each_mesh_entry(tbl, node, i) {
126 if (rcu_dereference(mpath->next_hop) == sta &&
127 mpath->flags & MESH_PATH_ACTIVE &&
128 @@ -792,13 +786,12 @@ void mesh_path_flush_by_nexthop(struct s
129 struct mesh_table *tbl;
130 struct mesh_path *mpath;
131 struct mpath_node *node;
132 - struct hlist_node *p;
136 read_lock_bh(&pathtbl_resize_lock);
137 tbl = resize_dereference_mesh_paths();
138 - for_each_mesh_entry(tbl, p, node, i) {
139 + for_each_mesh_entry(tbl, node, i) {
141 if (rcu_dereference(mpath->next_hop) == sta) {
142 spin_lock(&tbl->hashwlock[i]);
143 @@ -815,11 +808,9 @@ static void table_flush_by_iface(struct
145 struct mesh_path *mpath;
146 struct mpath_node *node;
147 - struct hlist_node *p;
150 - WARN_ON(!rcu_read_lock_held());
151 - for_each_mesh_entry(tbl, p, node, i) {
152 + for_each_mesh_entry(tbl, node, i) {
154 if (mpath->sdata != sdata)
156 @@ -865,7 +856,6 @@ int mesh_path_del(struct ieee80211_sub_i
157 struct mesh_path *mpath;
158 struct mpath_node *node;
159 struct hlist_head *bucket;
160 - struct hlist_node *n;
164 @@ -875,7 +865,7 @@ int mesh_path_del(struct ieee80211_sub_i
165 bucket = &tbl->hash_buckets[hash_idx];
167 spin_lock(&tbl->hashwlock[hash_idx]);
168 - hlist_for_each_entry(node, n, bucket, list) {
169 + hlist_for_each_entry(node, bucket, list) {
171 if (mpath->sdata == sdata &&
172 ether_addr_equal(addr, mpath->dst)) {
173 @@ -920,7 +910,6 @@ void mesh_path_tx_pending(struct mesh_pa
174 int mesh_path_send_to_gates(struct mesh_path *mpath)
176 struct ieee80211_sub_if_data *sdata = mpath->sdata;
177 - struct hlist_node *n;
178 struct mesh_table *tbl;
179 struct mesh_path *from_mpath = mpath;
180 struct mpath_node *gate = NULL;
181 @@ -935,7 +924,7 @@ int mesh_path_send_to_gates(struct mesh_
183 return -EHOSTUNREACH;
185 - hlist_for_each_entry_rcu(gate, n, known_gates, list) {
186 + hlist_for_each_entry_rcu(gate, known_gates, list) {
187 if (gate->mpath->sdata != sdata)
190 @@ -951,7 +940,7 @@ int mesh_path_send_to_gates(struct mesh_
194 - hlist_for_each_entry_rcu(gate, n, known_gates, list)
195 + hlist_for_each_entry_rcu(gate, known_gates, list)
196 if (gate->mpath->sdata == sdata) {
197 mpath_dbg(sdata, "Sending to %pM\n", gate->mpath->dst);
198 mesh_path_tx_pending(gate->mpath);
199 @@ -1096,12 +1085,11 @@ void mesh_path_expire(struct ieee80211_s
200 struct mesh_table *tbl;
201 struct mesh_path *mpath;
202 struct mpath_node *node;
203 - struct hlist_node *p;
207 tbl = rcu_dereference(mesh_paths);
208 - for_each_mesh_entry(tbl, p, node, i) {
209 + for_each_mesh_entry(tbl, node, i) {
210 if (node->mpath->sdata != sdata)