aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2013-02-27 20:06:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:24 -0500
commitb67bfe0d42cac56c512dd5da4b1b347a23f4b70a (patch)
tree3d465aea12b97683f26ffa38eba8744469de9997 /net/batman-adv
parent1e142b29e210b5dfb2deeb6ce2210b60af16d2a6 (diff)
hlist: drop the node parameter from iterators
I'm not sure why, but the hlist for each entry iterators were conceived list_for_each_entry(pos, head, member) The hlist ones were greedy and wanted an extra parameter: hlist_for_each_entry(tpos, pos, head, member) Why did they need an extra pos parameter? I'm not quite sure. Not only they don't really need it, it also prevents the iterator from looking exactly like the list iterator, which is unfortunate. Besides the semantic patch, there was some manual work required: - Fix up the actual hlist iterators in linux/list.h - Fix up the declaration of other iterators based on the hlist ones. - A very small amount of places were using the 'node' parameter, this was modified to use 'obj->member' instead. - Coccinelle didn't handle the hlist_for_each_entry_safe iterator properly, so those had to be fixed up manually. The semantic patch which is mostly the work of Peter Senna Tschudin is here: @@ iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host; type T; expression a,c,d,e; identifier b; statement S; @@ -T b; <+... when != b ( hlist_for_each_entry(a, - b, c, d) S | hlist_for_each_entry_continue(a, - b, c) S | hlist_for_each_entry_from(a, - b, c) S | hlist_for_each_entry_rcu(a, - b, c, d) S | hlist_for_each_entry_rcu_bh(a, - b, c, d) S | hlist_for_each_entry_continue_rcu_bh(a, - b, c) S | for_each_busy_worker(a, c, - b, d) S | ax25_uid_for_each(a, - b, c) S | ax25_for_each(a, - b, c) S | inet_bind_bucket_for_each(a, - b, c) S | sctp_for_each_hentry(a, - b, c) S | sk_for_each(a, - b, c) S | sk_for_each_rcu(a, - b, c) S | sk_for_each_from -(a, b) +(a) S + sk_for_each_from(a) S | sk_for_each_safe(a, - b, c, d) S | sk_for_each_bound(a, - b, c) S | hlist_for_each_entry_safe(a, - b, c, d, e) S | hlist_for_each_entry_continue_rcu(a, - b, c) S | nr_neigh_for_each(a, - b, c) S | nr_neigh_for_each_safe(a, - b, c, d) S | nr_node_for_each(a, - b, c) S | nr_node_for_each_safe(a, - b, c, d) S | - for_each_gfn_sp(a, c, d, b) S + for_each_gfn_sp(a, c, d) S | - for_each_gfn_indirect_valid_sp(a, c, d, b) S + for_each_gfn_indirect_valid_sp(a, c, d) S | for_each_host(a, - b, c) S | for_each_host_safe(a, - b, c, d) S | for_each_mesh_entry(a, - b, c, d) S ) ...+> [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c] [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c] [akpm@linux-foundation.org: checkpatch fixes] [akpm@linux-foundation.org: fix warnings] [akpm@linux-foudnation.org: redo intrusive kvm changes] Tested-by: Peter Senna Tschudin <peter.senna@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Gleb Natapov <gleb@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/bat_iv_ogm.c12
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c39
-rw-r--r--net/batman-adv/distributed-arp-table.c15
-rw-r--r--net/batman-adv/gateway_client.c13
-rw-r--r--net/batman-adv/main.c6
-rw-r--r--net/batman-adv/originator.c31
-rw-r--r--net/batman-adv/originator.h3
-rw-r--r--net/batman-adv/routing.c6
-rw-r--r--net/batman-adv/send.c6
-rw-r--r--net/batman-adv/translation-table.c82
-rw-r--r--net/batman-adv/vis.c38
11 files changed, 102 insertions, 149 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 72fe1bbf7721..a0b253ecadaf 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -487,7 +487,6 @@ static void batadv_iv_ogm_queue_add(struct batadv_priv *bat_priv,
487 */ 487 */
488 struct batadv_forw_packet *forw_packet_aggr = NULL; 488 struct batadv_forw_packet *forw_packet_aggr = NULL;
489 struct batadv_forw_packet *forw_packet_pos = NULL; 489 struct batadv_forw_packet *forw_packet_pos = NULL;
490 struct hlist_node *tmp_node;
491 struct batadv_ogm_packet *batadv_ogm_packet; 490 struct batadv_ogm_packet *batadv_ogm_packet;
492 bool direct_link; 491 bool direct_link;
493 unsigned long max_aggregation_jiffies; 492 unsigned long max_aggregation_jiffies;
@@ -500,7 +499,7 @@ static void batadv_iv_ogm_queue_add(struct batadv_priv *bat_priv,
500 spin_lock_bh(&bat_priv->forw_bat_list_lock); 499 spin_lock_bh(&bat_priv->forw_bat_list_lock);
501 /* own packets are not to be aggregated */ 500 /* own packets are not to be aggregated */
502 if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) { 501 if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) {
503 hlist_for_each_entry(forw_packet_pos, tmp_node, 502 hlist_for_each_entry(forw_packet_pos,
504 &bat_priv->forw_bat_list, list) { 503 &bat_priv->forw_bat_list, list) {
505 if (batadv_iv_ogm_can_aggregate(batadv_ogm_packet, 504 if (batadv_iv_ogm_can_aggregate(batadv_ogm_packet,
506 bat_priv, packet_len, 505 bat_priv, packet_len,
@@ -655,7 +654,6 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
655 struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; 654 struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL;
656 struct batadv_neigh_node *router = NULL; 655 struct batadv_neigh_node *router = NULL;
657 struct batadv_orig_node *orig_node_tmp; 656 struct batadv_orig_node *orig_node_tmp;
658 struct hlist_node *node;
659 int if_num; 657 int if_num;
660 uint8_t sum_orig, sum_neigh; 658 uint8_t sum_orig, sum_neigh;
661 uint8_t *neigh_addr; 659 uint8_t *neigh_addr;
@@ -665,7 +663,7 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
665 "update_originator(): Searching and updating originator entry of received packet\n"); 663 "update_originator(): Searching and updating originator entry of received packet\n");
666 664
667 rcu_read_lock(); 665 rcu_read_lock();
668 hlist_for_each_entry_rcu(tmp_neigh_node, node, 666 hlist_for_each_entry_rcu(tmp_neigh_node,
669 &orig_node->neigh_list, list) { 667 &orig_node->neigh_list, list) {
670 neigh_addr = tmp_neigh_node->addr; 668 neigh_addr = tmp_neigh_node->addr;
671 if (batadv_compare_eth(neigh_addr, ethhdr->h_source) && 669 if (batadv_compare_eth(neigh_addr, ethhdr->h_source) &&
@@ -801,7 +799,6 @@ static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node,
801{ 799{
802 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 800 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
803 struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node; 801 struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node;
804 struct hlist_node *node;
805 uint8_t total_count; 802 uint8_t total_count;
806 uint8_t orig_eq_count, neigh_rq_count, neigh_rq_inv, tq_own; 803 uint8_t orig_eq_count, neigh_rq_count, neigh_rq_inv, tq_own;
807 unsigned int neigh_rq_inv_cube, neigh_rq_max_cube; 804 unsigned int neigh_rq_inv_cube, neigh_rq_max_cube;
@@ -810,7 +807,7 @@ static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node,
810 807
811 /* find corresponding one hop neighbor */ 808 /* find corresponding one hop neighbor */
812 rcu_read_lock(); 809 rcu_read_lock();
813 hlist_for_each_entry_rcu(tmp_neigh_node, node, 810 hlist_for_each_entry_rcu(tmp_neigh_node,
814 &orig_neigh_node->neigh_list, list) { 811 &orig_neigh_node->neigh_list, list) {
815 if (!batadv_compare_eth(tmp_neigh_node->addr, 812 if (!batadv_compare_eth(tmp_neigh_node->addr,
816 orig_neigh_node->orig)) 813 orig_neigh_node->orig))
@@ -920,7 +917,6 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
920 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 917 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
921 struct batadv_orig_node *orig_node; 918 struct batadv_orig_node *orig_node;
922 struct batadv_neigh_node *tmp_neigh_node; 919 struct batadv_neigh_node *tmp_neigh_node;
923 struct hlist_node *node;
924 int is_duplicate = 0; 920 int is_duplicate = 0;
925 int32_t seq_diff; 921 int32_t seq_diff;
926 int need_update = 0; 922 int need_update = 0;
@@ -943,7 +939,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
943 goto out; 939 goto out;
944 940
945 rcu_read_lock(); 941 rcu_read_lock();
946 hlist_for_each_entry_rcu(tmp_neigh_node, node, 942 hlist_for_each_entry_rcu(tmp_neigh_node,
947 &orig_node->neigh_list, list) { 943 &orig_node->neigh_list, list) {
948 is_duplicate |= batadv_test_bit(tmp_neigh_node->real_bits, 944 is_duplicate |= batadv_test_bit(tmp_neigh_node->real_bits,
949 orig_node->last_real_seqno, 945 orig_node->last_real_seqno,
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 30f46526cbbd..6a4f728680ae 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -144,7 +144,6 @@ static struct batadv_bla_claim
144{ 144{
145 struct batadv_hashtable *hash = bat_priv->bla.claim_hash; 145 struct batadv_hashtable *hash = bat_priv->bla.claim_hash;
146 struct hlist_head *head; 146 struct hlist_head *head;
147 struct hlist_node *node;
148 struct batadv_bla_claim *claim; 147 struct batadv_bla_claim *claim;
149 struct batadv_bla_claim *claim_tmp = NULL; 148 struct batadv_bla_claim *claim_tmp = NULL;
150 int index; 149 int index;
@@ -156,7 +155,7 @@ static struct batadv_bla_claim
156 head = &hash->table[index]; 155 head = &hash->table[index];
157 156
158 rcu_read_lock(); 157 rcu_read_lock();
159 hlist_for_each_entry_rcu(claim, node, head, hash_entry) { 158 hlist_for_each_entry_rcu(claim, head, hash_entry) {
160 if (!batadv_compare_claim(&claim->hash_entry, data)) 159 if (!batadv_compare_claim(&claim->hash_entry, data))
161 continue; 160 continue;
162 161
@@ -185,7 +184,6 @@ batadv_backbone_hash_find(struct batadv_priv *bat_priv,
185{ 184{
186 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash; 185 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash;
187 struct hlist_head *head; 186 struct hlist_head *head;
188 struct hlist_node *node;
189 struct batadv_bla_backbone_gw search_entry, *backbone_gw; 187 struct batadv_bla_backbone_gw search_entry, *backbone_gw;
190 struct batadv_bla_backbone_gw *backbone_gw_tmp = NULL; 188 struct batadv_bla_backbone_gw *backbone_gw_tmp = NULL;
191 int index; 189 int index;
@@ -200,7 +198,7 @@ batadv_backbone_hash_find(struct batadv_priv *bat_priv,
200 head = &hash->table[index]; 198 head = &hash->table[index];
201 199
202 rcu_read_lock(); 200 rcu_read_lock();
203 hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { 201 hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) {
204 if (!batadv_compare_backbone_gw(&backbone_gw->hash_entry, 202 if (!batadv_compare_backbone_gw(&backbone_gw->hash_entry,
205 &search_entry)) 203 &search_entry))
206 continue; 204 continue;
@@ -221,7 +219,7 @@ static void
221batadv_bla_del_backbone_claims(struct batadv_bla_backbone_gw *backbone_gw) 219batadv_bla_del_backbone_claims(struct batadv_bla_backbone_gw *backbone_gw)
222{ 220{
223 struct batadv_hashtable *hash; 221 struct batadv_hashtable *hash;
224 struct hlist_node *node, *node_tmp; 222 struct hlist_node *node_tmp;
225 struct hlist_head *head; 223 struct hlist_head *head;
226 struct batadv_bla_claim *claim; 224 struct batadv_bla_claim *claim;
227 int i; 225 int i;
@@ -236,13 +234,13 @@ batadv_bla_del_backbone_claims(struct batadv_bla_backbone_gw *backbone_gw)
236 list_lock = &hash->list_locks[i]; 234 list_lock = &hash->list_locks[i];
237 235
238 spin_lock_bh(list_lock); 236 spin_lock_bh(list_lock);
239 hlist_for_each_entry_safe(claim, node, node_tmp, 237 hlist_for_each_entry_safe(claim, node_tmp,
240 head, hash_entry) { 238 head, hash_entry) {
241 if (claim->backbone_gw != backbone_gw) 239 if (claim->backbone_gw != backbone_gw)
242 continue; 240 continue;
243 241
244 batadv_claim_free_ref(claim); 242 batadv_claim_free_ref(claim);
245 hlist_del_rcu(node); 243 hlist_del_rcu(&claim->hash_entry);
246 } 244 }
247 spin_unlock_bh(list_lock); 245 spin_unlock_bh(list_lock);
248 } 246 }
@@ -460,7 +458,6 @@ static void batadv_bla_answer_request(struct batadv_priv *bat_priv,
460 struct batadv_hard_iface *primary_if, 458 struct batadv_hard_iface *primary_if,
461 short vid) 459 short vid)
462{ 460{
463 struct hlist_node *node;
464 struct hlist_head *head; 461 struct hlist_head *head;
465 struct batadv_hashtable *hash; 462 struct batadv_hashtable *hash;
466 struct batadv_bla_claim *claim; 463 struct batadv_bla_claim *claim;
@@ -481,7 +478,7 @@ static void batadv_bla_answer_request(struct batadv_priv *bat_priv,
481 head = &hash->table[i]; 478 head = &hash->table[i];
482 479
483 rcu_read_lock(); 480 rcu_read_lock();
484 hlist_for_each_entry_rcu(claim, node, head, hash_entry) { 481 hlist_for_each_entry_rcu(claim, head, hash_entry) {
485 /* only own claims are interesting */ 482 /* only own claims are interesting */
486 if (claim->backbone_gw != backbone_gw) 483 if (claim->backbone_gw != backbone_gw)
487 continue; 484 continue;
@@ -958,7 +955,7 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv,
958static void batadv_bla_purge_backbone_gw(struct batadv_priv *bat_priv, int now) 955static void batadv_bla_purge_backbone_gw(struct batadv_priv *bat_priv, int now)
959{ 956{
960 struct batadv_bla_backbone_gw *backbone_gw; 957 struct batadv_bla_backbone_gw *backbone_gw;
961 struct hlist_node *node, *node_tmp; 958 struct hlist_node *node_tmp;
962 struct hlist_head *head; 959 struct hlist_head *head;
963 struct batadv_hashtable *hash; 960 struct batadv_hashtable *hash;
964 spinlock_t *list_lock; /* protects write access to the hash lists */ 961 spinlock_t *list_lock; /* protects write access to the hash lists */
@@ -973,7 +970,7 @@ static void batadv_bla_purge_backbone_gw(struct batadv_priv *bat_priv, int now)
973 list_lock = &hash->list_locks[i]; 970 list_lock = &hash->list_locks[i];
974 971
975 spin_lock_bh(list_lock); 972 spin_lock_bh(list_lock);
976 hlist_for_each_entry_safe(backbone_gw, node, node_tmp, 973 hlist_for_each_entry_safe(backbone_gw, node_tmp,
977 head, hash_entry) { 974 head, hash_entry) {
978 if (now) 975 if (now)
979 goto purge_now; 976 goto purge_now;
@@ -992,7 +989,7 @@ purge_now:
992 989
993 batadv_bla_del_backbone_claims(backbone_gw); 990 batadv_bla_del_backbone_claims(backbone_gw);
994 991
995 hlist_del_rcu(node); 992 hlist_del_rcu(&backbone_gw->hash_entry);
996 batadv_backbone_gw_free_ref(backbone_gw); 993 batadv_backbone_gw_free_ref(backbone_gw);
997 } 994 }
998 spin_unlock_bh(list_lock); 995 spin_unlock_bh(list_lock);
@@ -1013,7 +1010,6 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv,
1013 int now) 1010 int now)
1014{ 1011{
1015 struct batadv_bla_claim *claim; 1012 struct batadv_bla_claim *claim;
1016 struct hlist_node *node;
1017 struct hlist_head *head; 1013 struct hlist_head *head;
1018 struct batadv_hashtable *hash; 1014 struct batadv_hashtable *hash;
1019 int i; 1015 int i;
@@ -1026,7 +1022,7 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv,
1026 head = &hash->table[i]; 1022 head = &hash->table[i];
1027 1023
1028 rcu_read_lock(); 1024 rcu_read_lock();
1029 hlist_for_each_entry_rcu(claim, node, head, hash_entry) { 1025 hlist_for_each_entry_rcu(claim, head, hash_entry) {
1030 if (now) 1026 if (now)
1031 goto purge_now; 1027 goto purge_now;
1032 if (!batadv_compare_eth(claim->backbone_gw->orig, 1028 if (!batadv_compare_eth(claim->backbone_gw->orig,
@@ -1062,7 +1058,6 @@ void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
1062 struct batadv_hard_iface *oldif) 1058 struct batadv_hard_iface *oldif)
1063{ 1059{
1064 struct batadv_bla_backbone_gw *backbone_gw; 1060 struct batadv_bla_backbone_gw *backbone_gw;
1065 struct hlist_node *node;
1066 struct hlist_head *head; 1061 struct hlist_head *head;
1067 struct batadv_hashtable *hash; 1062 struct batadv_hashtable *hash;
1068 __be16 group; 1063 __be16 group;
@@ -1086,7 +1081,7 @@ void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
1086 head = &hash->table[i]; 1081 head = &hash->table[i];
1087 1082
1088 rcu_read_lock(); 1083 rcu_read_lock();
1089 hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { 1084 hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) {
1090 /* own orig still holds the old value. */ 1085 /* own orig still holds the old value. */
1091 if (!batadv_compare_eth(backbone_gw->orig, 1086 if (!batadv_compare_eth(backbone_gw->orig,
1092 oldif->net_dev->dev_addr)) 1087 oldif->net_dev->dev_addr))
@@ -1112,7 +1107,6 @@ static void batadv_bla_periodic_work(struct work_struct *work)
1112 struct delayed_work *delayed_work; 1107 struct delayed_work *delayed_work;
1113 struct batadv_priv *bat_priv; 1108 struct batadv_priv *bat_priv;
1114 struct batadv_priv_bla *priv_bla; 1109 struct batadv_priv_bla *priv_bla;
1115 struct hlist_node *node;
1116 struct hlist_head *head; 1110 struct hlist_head *head;
1117 struct batadv_bla_backbone_gw *backbone_gw; 1111 struct batadv_bla_backbone_gw *backbone_gw;
1118 struct batadv_hashtable *hash; 1112 struct batadv_hashtable *hash;
@@ -1140,7 +1134,7 @@ static void batadv_bla_periodic_work(struct work_struct *work)
1140 head = &hash->table[i]; 1134 head = &hash->table[i];
1141 1135
1142 rcu_read_lock(); 1136 rcu_read_lock();
1143 hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { 1137 hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) {
1144 if (!batadv_compare_eth(backbone_gw->orig, 1138 if (!batadv_compare_eth(backbone_gw->orig,
1145 primary_if->net_dev->dev_addr)) 1139 primary_if->net_dev->dev_addr))
1146 continue; 1140 continue;
@@ -1322,7 +1316,6 @@ int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig)
1322{ 1316{
1323 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash; 1317 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash;
1324 struct hlist_head *head; 1318 struct hlist_head *head;
1325 struct hlist_node *node;
1326 struct batadv_bla_backbone_gw *backbone_gw; 1319 struct batadv_bla_backbone_gw *backbone_gw;
1327 int i; 1320 int i;
1328 1321
@@ -1336,7 +1329,7 @@ int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig)
1336 head = &hash->table[i]; 1329 head = &hash->table[i];
1337 1330
1338 rcu_read_lock(); 1331 rcu_read_lock();
1339 hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { 1332 hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) {
1340 if (batadv_compare_eth(backbone_gw->orig, orig)) { 1333 if (batadv_compare_eth(backbone_gw->orig, orig)) {
1341 rcu_read_unlock(); 1334 rcu_read_unlock();
1342 return 1; 1335 return 1;
@@ -1607,7 +1600,6 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
1607 struct batadv_hashtable *hash = bat_priv->bla.claim_hash; 1600 struct batadv_hashtable *hash = bat_priv->bla.claim_hash;
1608 struct batadv_bla_claim *claim; 1601 struct batadv_bla_claim *claim;
1609 struct batadv_hard_iface *primary_if; 1602 struct batadv_hard_iface *primary_if;
1610 struct hlist_node *node;
1611 struct hlist_head *head; 1603 struct hlist_head *head;
1612 uint32_t i; 1604 uint32_t i;
1613 bool is_own; 1605 bool is_own;
@@ -1628,7 +1620,7 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
1628 head = &hash->table[i]; 1620 head = &hash->table[i];
1629 1621
1630 rcu_read_lock(); 1622 rcu_read_lock();
1631 hlist_for_each_entry_rcu(claim, node, head, hash_entry) { 1623 hlist_for_each_entry_rcu(claim, head, hash_entry) {
1632 is_own = batadv_compare_eth(claim->backbone_gw->orig, 1624 is_own = batadv_compare_eth(claim->backbone_gw->orig,
1633 primary_addr); 1625 primary_addr);
1634 seq_printf(seq, " * %pM on % 5d by %pM [%c] (%#.4x)\n", 1626 seq_printf(seq, " * %pM on % 5d by %pM [%c] (%#.4x)\n",
@@ -1652,7 +1644,6 @@ int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq, void *offset)
1652 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash; 1644 struct batadv_hashtable *hash = bat_priv->bla.backbone_hash;
1653 struct batadv_bla_backbone_gw *backbone_gw; 1645 struct batadv_bla_backbone_gw *backbone_gw;
1654 struct batadv_hard_iface *primary_if; 1646 struct batadv_hard_iface *primary_if;
1655 struct hlist_node *node;
1656 struct hlist_head *head; 1647 struct hlist_head *head;
1657 int secs, msecs; 1648 int secs, msecs;
1658 uint32_t i; 1649 uint32_t i;
@@ -1674,7 +1665,7 @@ int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq, void *offset)
1674 head = &hash->table[i]; 1665 head = &hash->table[i];
1675 1666
1676 rcu_read_lock(); 1667 rcu_read_lock();
1677 hlist_for_each_entry_rcu(backbone_gw, node, head, hash_entry) { 1668 hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) {
1678 msecs = jiffies_to_msecs(jiffies - 1669 msecs = jiffies_to_msecs(jiffies -
1679 backbone_gw->lasttime); 1670 backbone_gw->lasttime);
1680 secs = msecs / 1000; 1671 secs = msecs / 1000;
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 761a59002e34..d54188a112ea 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -83,7 +83,7 @@ static void __batadv_dat_purge(struct batadv_priv *bat_priv,
83{ 83{
84 spinlock_t *list_lock; /* protects write access to the hash lists */ 84 spinlock_t *list_lock; /* protects write access to the hash lists */
85 struct batadv_dat_entry *dat_entry; 85 struct batadv_dat_entry *dat_entry;
86 struct hlist_node *node, *node_tmp; 86 struct hlist_node *node_tmp;
87 struct hlist_head *head; 87 struct hlist_head *head;
88 uint32_t i; 88 uint32_t i;
89 89
@@ -95,7 +95,7 @@ static void __batadv_dat_purge(struct batadv_priv *bat_priv,
95 list_lock = &bat_priv->dat.hash->list_locks[i]; 95 list_lock = &bat_priv->dat.hash->list_locks[i];
96 96
97 spin_lock_bh(list_lock); 97 spin_lock_bh(list_lock);
98 hlist_for_each_entry_safe(dat_entry, node, node_tmp, head, 98 hlist_for_each_entry_safe(dat_entry, node_tmp, head,
99 hash_entry) { 99 hash_entry) {
100 /* if an helper function has been passed as parameter, 100 /* if an helper function has been passed as parameter,
101 * ask it if the entry has to be purged or not 101 * ask it if the entry has to be purged or not
@@ -103,7 +103,7 @@ static void __batadv_dat_purge(struct batadv_priv *bat_priv,
103 if (to_purge && !to_purge(dat_entry)) 103 if (to_purge && !to_purge(dat_entry))
104 continue; 104 continue;
105 105
106 hlist_del_rcu(node); 106 hlist_del_rcu(&dat_entry->hash_entry);
107 batadv_dat_entry_free_ref(dat_entry); 107 batadv_dat_entry_free_ref(dat_entry);
108 } 108 }
109 spin_unlock_bh(list_lock); 109 spin_unlock_bh(list_lock);
@@ -235,7 +235,6 @@ static struct batadv_dat_entry *
235batadv_dat_entry_hash_find(struct batadv_priv *bat_priv, __be32 ip) 235batadv_dat_entry_hash_find(struct batadv_priv *bat_priv, __be32 ip)
236{ 236{
237 struct hlist_head *head; 237 struct hlist_head *head;
238 struct hlist_node *node;
239 struct batadv_dat_entry *dat_entry, *dat_entry_tmp = NULL; 238 struct batadv_dat_entry *dat_entry, *dat_entry_tmp = NULL;
240 struct batadv_hashtable *hash = bat_priv->dat.hash; 239 struct batadv_hashtable *hash = bat_priv->dat.hash;
241 uint32_t index; 240 uint32_t index;
@@ -247,7 +246,7 @@ batadv_dat_entry_hash_find(struct batadv_priv *bat_priv, __be32 ip)
247 head = &hash->table[index]; 246 head = &hash->table[index];
248 247
249 rcu_read_lock(); 248 rcu_read_lock();
250 hlist_for_each_entry_rcu(dat_entry, node, head, hash_entry) { 249 hlist_for_each_entry_rcu(dat_entry, head, hash_entry) {
251 if (dat_entry->ip != ip) 250 if (dat_entry->ip != ip)
252 continue; 251 continue;
253 252
@@ -465,7 +464,6 @@ static void batadv_choose_next_candidate(struct batadv_priv *bat_priv,
465 batadv_dat_addr_t max = 0, tmp_max = 0; 464 batadv_dat_addr_t max = 0, tmp_max = 0;
466 struct batadv_orig_node *orig_node, *max_orig_node = NULL; 465 struct batadv_orig_node *orig_node, *max_orig_node = NULL;
467 struct batadv_hashtable *hash = bat_priv->orig_hash; 466 struct batadv_hashtable *hash = bat_priv->orig_hash;
468 struct hlist_node *node;
469 struct hlist_head *head; 467 struct hlist_head *head;
470 int i; 468 int i;
471 469
@@ -481,7 +479,7 @@ static void batadv_choose_next_candidate(struct batadv_priv *bat_priv,
481 head = &hash->table[i]; 479 head = &hash->table[i];
482 480
483 rcu_read_lock(); 481 rcu_read_lock();
484 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 482 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
485 /* the dht space is a ring and addresses are unsigned */ 483 /* the dht space is a ring and addresses are unsigned */
486 tmp_max = BATADV_DAT_ADDR_MAX - orig_node->dat_addr + 484 tmp_max = BATADV_DAT_ADDR_MAX - orig_node->dat_addr +
487 ip_key; 485 ip_key;
@@ -686,7 +684,6 @@ int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset)
686 struct batadv_hashtable *hash = bat_priv->dat.hash; 684 struct batadv_hashtable *hash = bat_priv->dat.hash;
687 struct batadv_dat_entry *dat_entry; 685 struct batadv_dat_entry *dat_entry;
688 struct batadv_hard_iface *primary_if; 686 struct batadv_hard_iface *primary_if;
689 struct hlist_node *node;
690 struct hlist_head *head; 687 struct hlist_head *head;
691 unsigned long last_seen_jiffies; 688 unsigned long last_seen_jiffies;
692 int last_seen_msecs, last_seen_secs, last_seen_mins; 689 int last_seen_msecs, last_seen_secs, last_seen_mins;
@@ -704,7 +701,7 @@ int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset)
704 head = &hash->table[i]; 701 head = &hash->table[i];
705 702
706 rcu_read_lock(); 703 rcu_read_lock();
707 hlist_for_each_entry_rcu(dat_entry, node, head, hash_entry) { 704 hlist_for_each_entry_rcu(dat_entry, head, hash_entry) {
708 last_seen_jiffies = jiffies - dat_entry->last_update; 705 last_seen_jiffies = jiffies - dat_entry->last_update;
709 last_seen_msecs = jiffies_to_msecs(last_seen_jiffies); 706 last_seen_msecs = jiffies_to_msecs(last_seen_jiffies);
710 last_seen_mins = last_seen_msecs / 60000; 707 last_seen_mins = last_seen_msecs / 60000;
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 074107f2cfaa..34f99a46ec1d 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -114,7 +114,6 @@ static struct batadv_gw_node *
114batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv) 114batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv)
115{ 115{
116 struct batadv_neigh_node *router; 116 struct batadv_neigh_node *router;
117 struct hlist_node *node;
118 struct batadv_gw_node *gw_node, *curr_gw = NULL; 117 struct batadv_gw_node *gw_node, *curr_gw = NULL;
119 uint32_t max_gw_factor = 0, tmp_gw_factor = 0; 118 uint32_t max_gw_factor = 0, tmp_gw_factor = 0;
120 uint32_t gw_divisor; 119 uint32_t gw_divisor;
@@ -127,7 +126,7 @@ batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv)
127 gw_divisor *= 64; 126 gw_divisor *= 64;
128 127
129 rcu_read_lock(); 128 rcu_read_lock();
130 hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw.list, list) { 129 hlist_for_each_entry_rcu(gw_node, &bat_priv->gw.list, list) {
131 if (gw_node->deleted) 130 if (gw_node->deleted)
132 continue; 131 continue;
133 132
@@ -344,7 +343,6 @@ void batadv_gw_node_update(struct batadv_priv *bat_priv,
344 struct batadv_orig_node *orig_node, 343 struct batadv_orig_node *orig_node,
345 uint8_t new_gwflags) 344 uint8_t new_gwflags)
346{ 345{
347 struct hlist_node *node;
348 struct batadv_gw_node *gw_node, *curr_gw; 346 struct batadv_gw_node *gw_node, *curr_gw;
349 347
350 /* Note: We don't need a NULL check here, since curr_gw never gets 348 /* Note: We don't need a NULL check here, since curr_gw never gets
@@ -355,7 +353,7 @@ void batadv_gw_node_update(struct batadv_priv *bat_priv,
355 curr_gw = batadv_gw_get_selected_gw_node(bat_priv); 353 curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
356 354
357 rcu_read_lock(); 355 rcu_read_lock();
358 hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw.list, list) { 356 hlist_for_each_entry_rcu(gw_node, &bat_priv->gw.list, list) {
359 if (gw_node->orig_node != orig_node) 357 if (gw_node->orig_node != orig_node)
360 continue; 358 continue;
361 359
@@ -403,7 +401,7 @@ void batadv_gw_node_delete(struct batadv_priv *bat_priv,
403void batadv_gw_node_purge(struct batadv_priv *bat_priv) 401void batadv_gw_node_purge(struct batadv_priv *bat_priv)
404{ 402{
405 struct batadv_gw_node *gw_node, *curr_gw; 403 struct batadv_gw_node *gw_node, *curr_gw;
406 struct hlist_node *node, *node_tmp; 404 struct hlist_node *node_tmp;
407 unsigned long timeout = msecs_to_jiffies(2 * BATADV_PURGE_TIMEOUT); 405 unsigned long timeout = msecs_to_jiffies(2 * BATADV_PURGE_TIMEOUT);
408 int do_deselect = 0; 406 int do_deselect = 0;
409 407
@@ -411,7 +409,7 @@ void batadv_gw_node_purge(struct batadv_priv *bat_priv)
411 409
412 spin_lock_bh(&bat_priv->gw.list_lock); 410 spin_lock_bh(&bat_priv->gw.list_lock);
413 411
414 hlist_for_each_entry_safe(gw_node, node, node_tmp, 412 hlist_for_each_entry_safe(gw_node, node_tmp,
415 &bat_priv->gw.list, list) { 413 &bat_priv->gw.list, list) {
416 if (((!gw_node->deleted) || 414 if (((!gw_node->deleted) ||
417 (time_before(jiffies, gw_node->deleted + timeout))) && 415 (time_before(jiffies, gw_node->deleted + timeout))) &&
@@ -476,7 +474,6 @@ int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset)
476 struct batadv_priv *bat_priv = netdev_priv(net_dev); 474 struct batadv_priv *bat_priv = netdev_priv(net_dev);
477 struct batadv_hard_iface *primary_if; 475 struct batadv_hard_iface *primary_if;
478 struct batadv_gw_node *gw_node; 476 struct batadv_gw_node *gw_node;
479 struct hlist_node *node;
480 int gw_count = 0; 477 int gw_count = 0;
481 478
482 primary_if = batadv_seq_print_text_primary_if_get(seq); 479 primary_if = batadv_seq_print_text_primary_if_get(seq);
@@ -490,7 +487,7 @@ int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset)
490 primary_if->net_dev->dev_addr, net_dev->name); 487 primary_if->net_dev->dev_addr, net_dev->name);
491 488
492 rcu_read_lock(); 489 rcu_read_lock();
493 hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw.list, list) { 490 hlist_for_each_entry_rcu(gw_node, &bat_priv->gw.list, list) {
494 if (gw_node->deleted) 491 if (gw_node->deleted)
495 continue; 492 continue;
496 493
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 21fe6987733b..0488d70c8c35 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -345,9 +345,8 @@ void batadv_recv_handler_unregister(uint8_t packet_type)
345static struct batadv_algo_ops *batadv_algo_get(char *name) 345static struct batadv_algo_ops *batadv_algo_get(char *name)
346{ 346{
347 struct batadv_algo_ops *bat_algo_ops = NULL, *bat_algo_ops_tmp; 347 struct batadv_algo_ops *bat_algo_ops = NULL, *bat_algo_ops_tmp;
348 struct hlist_node *node;
349 348
350 hlist_for_each_entry(bat_algo_ops_tmp, node, &batadv_algo_list, list) { 349 hlist_for_each_entry(bat_algo_ops_tmp, &batadv_algo_list, list) {
351 if (strcmp(bat_algo_ops_tmp->name, name) != 0) 350 if (strcmp(bat_algo_ops_tmp->name, name) != 0)
352 continue; 351 continue;
353 352
@@ -411,11 +410,10 @@ out:
411int batadv_algo_seq_print_text(struct seq_file *seq, void *offset) 410int batadv_algo_seq_print_text(struct seq_file *seq, void *offset)
412{ 411{
413 struct batadv_algo_ops *bat_algo_ops; 412 struct batadv_algo_ops *bat_algo_ops;
414 struct hlist_node *node;
415 413
416 seq_printf(seq, "Available routing algorithms:\n"); 414 seq_printf(seq, "Available routing algorithms:\n");
417 415
418 hlist_for_each_entry(bat_algo_ops, node, &batadv_algo_list, list) { 416 hlist_for_each_entry(bat_algo_ops, &batadv_algo_list, list) {
419 seq_printf(seq, "%s\n", bat_algo_ops->name); 417 seq_printf(seq, "%s\n", bat_algo_ops->name);
420 } 418 }
421 419
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 457ea445217c..96fb80b724dc 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -118,7 +118,7 @@ out:
118 118
119static void batadv_orig_node_free_rcu(struct rcu_head *rcu) 119static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
120{ 120{
121 struct hlist_node *node, *node_tmp; 121 struct hlist_node *node_tmp;
122 struct batadv_neigh_node *neigh_node, *tmp_neigh_node; 122 struct batadv_neigh_node *neigh_node, *tmp_neigh_node;
123 struct batadv_orig_node *orig_node; 123 struct batadv_orig_node *orig_node;
124 124
@@ -134,7 +134,7 @@ static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
134 } 134 }
135 135
136 /* for all neighbors towards this originator ... */ 136 /* for all neighbors towards this originator ... */
137 hlist_for_each_entry_safe(neigh_node, node, node_tmp, 137 hlist_for_each_entry_safe(neigh_node, node_tmp,
138 &orig_node->neigh_list, list) { 138 &orig_node->neigh_list, list) {
139 hlist_del_rcu(&neigh_node->list); 139 hlist_del_rcu(&neigh_node->list);
140 batadv_neigh_node_free_ref(neigh_node); 140 batadv_neigh_node_free_ref(neigh_node);
@@ -161,7 +161,7 @@ void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node)
161void batadv_originator_free(struct batadv_priv *bat_priv) 161void batadv_originator_free(struct batadv_priv *bat_priv)
162{ 162{
163 struct batadv_hashtable *hash = bat_priv->orig_hash; 163 struct batadv_hashtable *hash = bat_priv->orig_hash;
164 struct hlist_node *node, *node_tmp; 164 struct hlist_node *node_tmp;
165 struct hlist_head *head; 165 struct hlist_head *head;
166 spinlock_t *list_lock; /* spinlock to protect write access */ 166 spinlock_t *list_lock; /* spinlock to protect write access */
167 struct batadv_orig_node *orig_node; 167 struct batadv_orig_node *orig_node;
@@ -179,9 +179,9 @@ void batadv_originator_free(struct batadv_priv *bat_priv)
179 list_lock = &hash->list_locks[i]; 179 list_lock = &hash->list_locks[i];
180 180
181 spin_lock_bh(list_lock); 181 spin_lock_bh(list_lock);
182 hlist_for_each_entry_safe(orig_node, node, node_tmp, 182 hlist_for_each_entry_safe(orig_node, node_tmp,
183 head, hash_entry) { 183 head, hash_entry) {
184 hlist_del_rcu(node); 184 hlist_del_rcu(&orig_node->hash_entry);
185 batadv_orig_node_free_ref(orig_node); 185 batadv_orig_node_free_ref(orig_node);
186 } 186 }
187 spin_unlock_bh(list_lock); 187 spin_unlock_bh(list_lock);
@@ -274,7 +274,7 @@ batadv_purge_orig_neighbors(struct batadv_priv *bat_priv,
274 struct batadv_orig_node *orig_node, 274 struct batadv_orig_node *orig_node,
275 struct batadv_neigh_node **best_neigh_node) 275 struct batadv_neigh_node **best_neigh_node)
276{ 276{
277 struct hlist_node *node, *node_tmp; 277 struct hlist_node *node_tmp;
278 struct batadv_neigh_node *neigh_node; 278 struct batadv_neigh_node *neigh_node;
279 bool neigh_purged = false; 279 bool neigh_purged = false;
280 unsigned long last_seen; 280 unsigned long last_seen;
@@ -285,7 +285,7 @@ batadv_purge_orig_neighbors(struct batadv_priv *bat_priv,
285 spin_lock_bh(&orig_node->neigh_list_lock); 285 spin_lock_bh(&orig_node->neigh_list_lock);
286 286
287 /* for all neighbors towards this originator ... */ 287 /* for all neighbors towards this originator ... */
288 hlist_for_each_entry_safe(neigh_node, node, node_tmp, 288 hlist_for_each_entry_safe(neigh_node, node_tmp,
289 &orig_node->neigh_list, list) { 289 &orig_node->neigh_list, list) {
290 last_seen = neigh_node->last_seen; 290 last_seen = neigh_node->last_seen;
291 if_incoming = neigh_node->if_incoming; 291 if_incoming = neigh_node->if_incoming;
@@ -348,7 +348,7 @@ static bool batadv_purge_orig_node(struct batadv_priv *bat_priv,
348static void _batadv_purge_orig(struct batadv_priv *bat_priv) 348static void _batadv_purge_orig(struct batadv_priv *bat_priv)
349{ 349{
350 struct batadv_hashtable *hash = bat_priv->orig_hash; 350 struct batadv_hashtable *hash = bat_priv->orig_hash;
351 struct hlist_node *node, *node_tmp; 351 struct hlist_node *node_tmp;
352 struct hlist_head *head; 352 struct hlist_head *head;
353 spinlock_t *list_lock; /* spinlock to protect write access */ 353 spinlock_t *list_lock; /* spinlock to protect write access */
354 struct batadv_orig_node *orig_node; 354 struct batadv_orig_node *orig_node;
@@ -363,13 +363,13 @@ static void _batadv_purge_orig(struct batadv_priv *bat_priv)
363 list_lock = &hash->list_locks[i]; 363 list_lock = &hash->list_locks[i];
364 364
365 spin_lock_bh(list_lock); 365 spin_lock_bh(list_lock);
366 hlist_for_each_entry_safe(orig_node, node, node_tmp, 366 hlist_for_each_entry_safe(orig_node, node_tmp,
367 head, hash_entry) { 367 head, hash_entry) {
368 if (batadv_purge_orig_node(bat_priv, orig_node)) { 368 if (batadv_purge_orig_node(bat_priv, orig_node)) {
369 if (orig_node->gw_flags) 369 if (orig_node->gw_flags)
370 batadv_gw_node_delete(bat_priv, 370 batadv_gw_node_delete(bat_priv,
371 orig_node); 371 orig_node);
372 hlist_del_rcu(node); 372 hlist_del_rcu(&orig_node->hash_entry);
373 batadv_orig_node_free_ref(orig_node); 373 batadv_orig_node_free_ref(orig_node);
374 continue; 374 continue;
375 } 375 }
@@ -408,7 +408,6 @@ int batadv_orig_seq_print_text(struct seq_file *seq, void *offset)
408 struct net_device *net_dev = (struct net_device *)seq->private; 408 struct net_device *net_dev = (struct net_device *)seq->private;
409 struct batadv_priv *bat_priv = netdev_priv(net_dev); 409 struct batadv_priv *bat_priv = netdev_priv(net_dev);
410 struct batadv_hashtable *hash = bat_priv->orig_hash; 410 struct batadv_hashtable *hash = bat_priv->orig_hash;
411 struct hlist_node *node, *node_tmp;
412 struct hlist_head *head; 411 struct hlist_head *head;
413 struct batadv_hard_iface *primary_if; 412 struct batadv_hard_iface *primary_if;
414 struct batadv_orig_node *orig_node; 413 struct batadv_orig_node *orig_node;
@@ -434,7 +433,7 @@ int batadv_orig_seq_print_text(struct seq_file *seq, void *offset)
434 head = &hash->table[i]; 433 head = &hash->table[i];
435 434
436 rcu_read_lock(); 435 rcu_read_lock();
437 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 436 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
438 neigh_node = batadv_orig_node_get_router(orig_node); 437 neigh_node = batadv_orig_node_get_router(orig_node);
439 if (!neigh_node) 438 if (!neigh_node)
440 continue; 439 continue;
@@ -453,7 +452,7 @@ int batadv_orig_seq_print_text(struct seq_file *seq, void *offset)
453 neigh_node->addr, 452 neigh_node->addr,
454 neigh_node->if_incoming->net_dev->name); 453 neigh_node->if_incoming->net_dev->name);
455 454
456 hlist_for_each_entry_rcu(neigh_node_tmp, node_tmp, 455 hlist_for_each_entry_rcu(neigh_node_tmp,
457 &orig_node->neigh_list, list) { 456 &orig_node->neigh_list, list) {
458 seq_printf(seq, " %pM (%3i)", 457 seq_printf(seq, " %pM (%3i)",
459 neigh_node_tmp->addr, 458 neigh_node_tmp->addr,
@@ -511,7 +510,6 @@ int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface,
511{ 510{
512 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 511 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
513 struct batadv_hashtable *hash = bat_priv->orig_hash; 512 struct batadv_hashtable *hash = bat_priv->orig_hash;
514 struct hlist_node *node;
515 struct hlist_head *head; 513 struct hlist_head *head;
516 struct batadv_orig_node *orig_node; 514 struct batadv_orig_node *orig_node;
517 uint32_t i; 515 uint32_t i;
@@ -524,7 +522,7 @@ int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface,
524 head = &hash->table[i]; 522 head = &hash->table[i];
525 523
526 rcu_read_lock(); 524 rcu_read_lock();
527 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 525 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
528 spin_lock_bh(&orig_node->ogm_cnt_lock); 526 spin_lock_bh(&orig_node->ogm_cnt_lock);
529 ret = batadv_orig_node_add_if(orig_node, max_if_num); 527 ret = batadv_orig_node_add_if(orig_node, max_if_num);
530 spin_unlock_bh(&orig_node->ogm_cnt_lock); 528 spin_unlock_bh(&orig_node->ogm_cnt_lock);
@@ -595,7 +593,6 @@ int batadv_orig_hash_del_if(struct batadv_hard_iface *hard_iface,
595{ 593{
596 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 594 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
597 struct batadv_hashtable *hash = bat_priv->orig_hash; 595 struct batadv_hashtable *hash = bat_priv->orig_hash;
598 struct hlist_node *node;
599 struct hlist_head *head; 596 struct hlist_head *head;
600 struct batadv_hard_iface *hard_iface_tmp; 597 struct batadv_hard_iface *hard_iface_tmp;
601 struct batadv_orig_node *orig_node; 598 struct batadv_orig_node *orig_node;
@@ -609,7 +606,7 @@ int batadv_orig_hash_del_if(struct batadv_hard_iface *hard_iface,
609 head = &hash->table[i]; 606 head = &hash->table[i];
610 607
611 rcu_read_lock(); 608 rcu_read_lock();
612 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 609 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
613 spin_lock_bh(&orig_node->ogm_cnt_lock); 610 spin_lock_bh(&orig_node->ogm_cnt_lock);
614 ret = batadv_orig_node_del_if(orig_node, max_if_num, 611 ret = batadv_orig_node_del_if(orig_node, max_if_num,
615 hard_iface->if_num); 612 hard_iface->if_num);
diff --git a/net/batman-adv/originator.h b/net/batman-adv/originator.h
index 286bf743e76a..7df48fa7669d 100644
--- a/net/batman-adv/originator.h
+++ b/net/batman-adv/originator.h
@@ -68,7 +68,6 @@ batadv_orig_hash_find(struct batadv_priv *bat_priv, const void *data)
68{ 68{
69 struct batadv_hashtable *hash = bat_priv->orig_hash; 69 struct batadv_hashtable *hash = bat_priv->orig_hash;
70 struct hlist_head *head; 70 struct hlist_head *head;
71 struct hlist_node *node;
72 struct batadv_orig_node *orig_node, *orig_node_tmp = NULL; 71 struct batadv_orig_node *orig_node, *orig_node_tmp = NULL;
73 int index; 72 int index;
74 73
@@ -79,7 +78,7 @@ batadv_orig_hash_find(struct batadv_priv *bat_priv, const void *data)
79 head = &hash->table[index]; 78 head = &hash->table[index];
80 79
81 rcu_read_lock(); 80 rcu_read_lock();
82 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 81 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
83 if (!batadv_compare_eth(orig_node, data)) 82 if (!batadv_compare_eth(orig_node, data))
84 continue; 83 continue;
85 84
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 60ba03fc8390..5ee21cebbbb0 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -37,7 +37,6 @@ void batadv_slide_own_bcast_window(struct batadv_hard_iface *hard_iface)
37{ 37{
38 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 38 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
39 struct batadv_hashtable *hash = bat_priv->orig_hash; 39 struct batadv_hashtable *hash = bat_priv->orig_hash;
40 struct hlist_node *node;
41 struct hlist_head *head; 40 struct hlist_head *head;
42 struct batadv_orig_node *orig_node; 41 struct batadv_orig_node *orig_node;
43 unsigned long *word; 42 unsigned long *word;
@@ -49,7 +48,7 @@ void batadv_slide_own_bcast_window(struct batadv_hard_iface *hard_iface)
49 head = &hash->table[i]; 48 head = &hash->table[i];
50 49
51 rcu_read_lock(); 50 rcu_read_lock();
52 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 51 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
53 spin_lock_bh(&orig_node->ogm_cnt_lock); 52 spin_lock_bh(&orig_node->ogm_cnt_lock);
54 word_index = hard_iface->if_num * BATADV_NUM_WORDS; 53 word_index = hard_iface->if_num * BATADV_NUM_WORDS;
55 word = &(orig_node->bcast_own[word_index]); 54 word = &(orig_node->bcast_own[word_index]);
@@ -146,7 +145,6 @@ out:
146void batadv_bonding_candidate_add(struct batadv_orig_node *orig_node, 145void batadv_bonding_candidate_add(struct batadv_orig_node *orig_node,
147 struct batadv_neigh_node *neigh_node) 146 struct batadv_neigh_node *neigh_node)
148{ 147{
149 struct hlist_node *node;
150 struct batadv_neigh_node *tmp_neigh_node, *router = NULL; 148 struct batadv_neigh_node *tmp_neigh_node, *router = NULL;
151 uint8_t interference_candidate = 0; 149 uint8_t interference_candidate = 0;
152 150
@@ -169,7 +167,7 @@ void batadv_bonding_candidate_add(struct batadv_orig_node *orig_node,
169 * interface. If we do, we won't select this candidate because of 167 * interface. If we do, we won't select this candidate because of
170 * possible interference. 168 * possible interference.
171 */ 169 */
172 hlist_for_each_entry_rcu(tmp_neigh_node, node, 170 hlist_for_each_entry_rcu(tmp_neigh_node,
173 &orig_node->neigh_list, list) { 171 &orig_node->neigh_list, list) {
174 if (tmp_neigh_node == neigh_node) 172 if (tmp_neigh_node == neigh_node)
175 continue; 173 continue;
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 80ca65fc89a1..a67cffde37ae 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -316,7 +316,7 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
316 const struct batadv_hard_iface *hard_iface) 316 const struct batadv_hard_iface *hard_iface)
317{ 317{
318 struct batadv_forw_packet *forw_packet; 318 struct batadv_forw_packet *forw_packet;
319 struct hlist_node *tmp_node, *safe_tmp_node; 319 struct hlist_node *safe_tmp_node;
320 bool pending; 320 bool pending;
321 321
322 if (hard_iface) 322 if (hard_iface)
@@ -329,7 +329,7 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
329 329
330 /* free bcast list */ 330 /* free bcast list */
331 spin_lock_bh(&bat_priv->forw_bcast_list_lock); 331 spin_lock_bh(&bat_priv->forw_bcast_list_lock);
332 hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node, 332 hlist_for_each_entry_safe(forw_packet, safe_tmp_node,
333 &bat_priv->forw_bcast_list, list) { 333 &bat_priv->forw_bcast_list, list) {
334 /* if purge_outstanding_packets() was called with an argument 334 /* if purge_outstanding_packets() was called with an argument
335 * we delete only packets belonging to the given interface 335 * we delete only packets belonging to the given interface
@@ -355,7 +355,7 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
355 355
356 /* free batman packet list */ 356 /* free batman packet list */
357 spin_lock_bh(&bat_priv->forw_bat_list_lock); 357 spin_lock_bh(&bat_priv->forw_bat_list_lock);
358 hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node, 358 hlist_for_each_entry_safe(forw_packet, safe_tmp_node,
359 &bat_priv->forw_bat_list, list) { 359 &bat_priv->forw_bat_list, list) {
360 /* if purge_outstanding_packets() was called with an argument 360 /* if purge_outstanding_packets() was called with an argument
361 * we delete only packets belonging to the given interface 361 * we delete only packets belonging to the given interface
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index d44672f4a349..98a66a021a60 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -56,7 +56,6 @@ static struct batadv_tt_common_entry *
56batadv_tt_hash_find(struct batadv_hashtable *hash, const void *data) 56batadv_tt_hash_find(struct batadv_hashtable *hash, const void *data)
57{ 57{
58 struct hlist_head *head; 58 struct hlist_head *head;
59 struct hlist_node *node;
60 struct batadv_tt_common_entry *tt_common_entry; 59 struct batadv_tt_common_entry *tt_common_entry;
61 struct batadv_tt_common_entry *tt_common_entry_tmp = NULL; 60 struct batadv_tt_common_entry *tt_common_entry_tmp = NULL;
62 uint32_t index; 61 uint32_t index;
@@ -68,7 +67,7 @@ batadv_tt_hash_find(struct batadv_hashtable *hash, const void *data)
68 head = &hash->table[index]; 67 head = &hash->table[index];
69 68
70 rcu_read_lock(); 69 rcu_read_lock();
71 hlist_for_each_entry_rcu(tt_common_entry, node, head, hash_entry) { 70 hlist_for_each_entry_rcu(tt_common_entry, head, hash_entry) {
72 if (!batadv_compare_eth(tt_common_entry, data)) 71 if (!batadv_compare_eth(tt_common_entry, data))
73 continue; 72 continue;
74 73
@@ -257,7 +256,6 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
257 struct batadv_tt_local_entry *tt_local; 256 struct batadv_tt_local_entry *tt_local;
258 struct batadv_tt_global_entry *tt_global; 257 struct batadv_tt_global_entry *tt_global;
259 struct hlist_head *head; 258 struct hlist_head *head;
260 struct hlist_node *node;
261 struct batadv_tt_orig_list_entry *orig_entry; 259 struct batadv_tt_orig_list_entry *orig_entry;
262 int hash_added; 260 int hash_added;
263 bool roamed_back = false; 261 bool roamed_back = false;
@@ -339,7 +337,7 @@ check_roaming:
339 /* These node are probably going to update their tt table */ 337 /* These node are probably going to update their tt table */
340 head = &tt_global->orig_list; 338 head = &tt_global->orig_list;
341 rcu_read_lock(); 339 rcu_read_lock();
342 hlist_for_each_entry_rcu(orig_entry, node, head, list) { 340 hlist_for_each_entry_rcu(orig_entry, head, list) {
343 batadv_send_roam_adv(bat_priv, tt_global->common.addr, 341 batadv_send_roam_adv(bat_priv, tt_global->common.addr,
344 orig_entry->orig_node); 342 orig_entry->orig_node);
345 } 343 }
@@ -470,7 +468,6 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
470 struct batadv_tt_common_entry *tt_common_entry; 468 struct batadv_tt_common_entry *tt_common_entry;
471 struct batadv_tt_local_entry *tt_local; 469 struct batadv_tt_local_entry *tt_local;
472 struct batadv_hard_iface *primary_if; 470 struct batadv_hard_iface *primary_if;
473 struct hlist_node *node;
474 struct hlist_head *head; 471 struct hlist_head *head;
475 uint32_t i; 472 uint32_t i;
476 int last_seen_secs; 473 int last_seen_secs;
@@ -494,7 +491,7 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
494 head = &hash->table[i]; 491 head = &hash->table[i];
495 492
496 rcu_read_lock(); 493 rcu_read_lock();
497 hlist_for_each_entry_rcu(tt_common_entry, node, 494 hlist_for_each_entry_rcu(tt_common_entry,
498 head, hash_entry) { 495 head, hash_entry) {
499 tt_local = container_of(tt_common_entry, 496 tt_local = container_of(tt_common_entry,
500 struct batadv_tt_local_entry, 497 struct batadv_tt_local_entry,
@@ -605,9 +602,9 @@ static void batadv_tt_local_purge_list(struct batadv_priv *bat_priv,
605{ 602{
606 struct batadv_tt_local_entry *tt_local_entry; 603 struct batadv_tt_local_entry *tt_local_entry;
607 struct batadv_tt_common_entry *tt_common_entry; 604 struct batadv_tt_common_entry *tt_common_entry;
608 struct hlist_node *node, *node_tmp; 605 struct hlist_node *node_tmp;
609 606
610 hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, head, 607 hlist_for_each_entry_safe(tt_common_entry, node_tmp, head,
611 hash_entry) { 608 hash_entry) {
612 tt_local_entry = container_of(tt_common_entry, 609 tt_local_entry = container_of(tt_common_entry,
613 struct batadv_tt_local_entry, 610 struct batadv_tt_local_entry,
@@ -651,7 +648,7 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
651 spinlock_t *list_lock; /* protects write access to the hash lists */ 648 spinlock_t *list_lock; /* protects write access to the hash lists */
652 struct batadv_tt_common_entry *tt_common_entry; 649 struct batadv_tt_common_entry *tt_common_entry;
653 struct batadv_tt_local_entry *tt_local; 650 struct batadv_tt_local_entry *tt_local;
654 struct hlist_node *node, *node_tmp; 651 struct hlist_node *node_tmp;
655 struct hlist_head *head; 652 struct hlist_head *head;
656 uint32_t i; 653 uint32_t i;
657 654
@@ -665,9 +662,9 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
665 list_lock = &hash->list_locks[i]; 662 list_lock = &hash->list_locks[i];
666 663
667 spin_lock_bh(list_lock); 664 spin_lock_bh(list_lock);
668 hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, 665 hlist_for_each_entry_safe(tt_common_entry, node_tmp,
669 head, hash_entry) { 666 head, hash_entry) {
670 hlist_del_rcu(node); 667 hlist_del_rcu(&tt_common_entry->hash_entry);
671 tt_local = container_of(tt_common_entry, 668 tt_local = container_of(tt_common_entry,
672 struct batadv_tt_local_entry, 669 struct batadv_tt_local_entry,
673 common); 670 common);
@@ -724,11 +721,10 @@ batadv_tt_global_orig_entry_find(const struct batadv_tt_global_entry *entry,
724{ 721{
725 struct batadv_tt_orig_list_entry *tmp_orig_entry, *orig_entry = NULL; 722 struct batadv_tt_orig_list_entry *tmp_orig_entry, *orig_entry = NULL;
726 const struct hlist_head *head; 723 const struct hlist_head *head;
727 struct hlist_node *node;
728 724
729 rcu_read_lock(); 725 rcu_read_lock();
730 head = &entry->orig_list; 726 head = &entry->orig_list;
731 hlist_for_each_entry_rcu(tmp_orig_entry, node, head, list) { 727 hlist_for_each_entry_rcu(tmp_orig_entry, head, list) {
732 if (tmp_orig_entry->orig_node != orig_node) 728 if (tmp_orig_entry->orig_node != orig_node)
733 continue; 729 continue;
734 if (!atomic_inc_not_zero(&tmp_orig_entry->refcount)) 730 if (!atomic_inc_not_zero(&tmp_orig_entry->refcount))
@@ -940,12 +936,11 @@ batadv_transtable_best_orig(struct batadv_tt_global_entry *tt_global_entry)
940{ 936{
941 struct batadv_neigh_node *router = NULL; 937 struct batadv_neigh_node *router = NULL;
942 struct hlist_head *head; 938 struct hlist_head *head;
943 struct hlist_node *node;
944 struct batadv_tt_orig_list_entry *orig_entry, *best_entry = NULL; 939 struct batadv_tt_orig_list_entry *orig_entry, *best_entry = NULL;
945 int best_tq = 0; 940 int best_tq = 0;
946 941
947 head = &tt_global_entry->orig_list; 942 head = &tt_global_entry->orig_list;
948 hlist_for_each_entry_rcu(orig_entry, node, head, list) { 943 hlist_for_each_entry_rcu(orig_entry, head, list) {
949 router = batadv_orig_node_get_router(orig_entry->orig_node); 944 router = batadv_orig_node_get_router(orig_entry->orig_node);
950 if (!router) 945 if (!router)
951 continue; 946 continue;
@@ -973,7 +968,6 @@ batadv_tt_global_print_entry(struct batadv_tt_global_entry *tt_global_entry,
973 struct seq_file *seq) 968 struct seq_file *seq)
974{ 969{
975 struct hlist_head *head; 970 struct hlist_head *head;
976 struct hlist_node *node;
977 struct batadv_tt_orig_list_entry *orig_entry, *best_entry; 971 struct batadv_tt_orig_list_entry *orig_entry, *best_entry;
978 struct batadv_tt_common_entry *tt_common_entry; 972 struct batadv_tt_common_entry *tt_common_entry;
979 uint16_t flags; 973 uint16_t flags;
@@ -997,7 +991,7 @@ batadv_tt_global_print_entry(struct batadv_tt_global_entry *tt_global_entry,
997 991
998 head = &tt_global_entry->orig_list; 992 head = &tt_global_entry->orig_list;
999 993
1000 hlist_for_each_entry_rcu(orig_entry, node, head, list) { 994 hlist_for_each_entry_rcu(orig_entry, head, list) {
1001 if (best_entry == orig_entry) 995 if (best_entry == orig_entry)
1002 continue; 996 continue;
1003 997
@@ -1020,7 +1014,6 @@ int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset)
1020 struct batadv_tt_common_entry *tt_common_entry; 1014 struct batadv_tt_common_entry *tt_common_entry;
1021 struct batadv_tt_global_entry *tt_global; 1015 struct batadv_tt_global_entry *tt_global;
1022 struct batadv_hard_iface *primary_if; 1016 struct batadv_hard_iface *primary_if;
1023 struct hlist_node *node;
1024 struct hlist_head *head; 1017 struct hlist_head *head;
1025 uint32_t i; 1018 uint32_t i;
1026 1019
@@ -1039,7 +1032,7 @@ int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset)
1039 head = &hash->table[i]; 1032 head = &hash->table[i];
1040 1033
1041 rcu_read_lock(); 1034 rcu_read_lock();
1042 hlist_for_each_entry_rcu(tt_common_entry, node, 1035 hlist_for_each_entry_rcu(tt_common_entry,
1043 head, hash_entry) { 1036 head, hash_entry) {
1044 tt_global = container_of(tt_common_entry, 1037 tt_global = container_of(tt_common_entry,
1045 struct batadv_tt_global_entry, 1038 struct batadv_tt_global_entry,
@@ -1059,13 +1052,13 @@ static void
1059batadv_tt_global_del_orig_list(struct batadv_tt_global_entry *tt_global_entry) 1052batadv_tt_global_del_orig_list(struct batadv_tt_global_entry *tt_global_entry)
1060{ 1053{
1061 struct hlist_head *head; 1054 struct hlist_head *head;
1062 struct hlist_node *node, *safe; 1055 struct hlist_node *safe;
1063 struct batadv_tt_orig_list_entry *orig_entry; 1056 struct batadv_tt_orig_list_entry *orig_entry;
1064 1057
1065 spin_lock_bh(&tt_global_entry->list_lock); 1058 spin_lock_bh(&tt_global_entry->list_lock);
1066 head = &tt_global_entry->orig_list; 1059 head = &tt_global_entry->orig_list;
1067 hlist_for_each_entry_safe(orig_entry, node, safe, head, list) { 1060 hlist_for_each_entry_safe(orig_entry, safe, head, list) {
1068 hlist_del_rcu(node); 1061 hlist_del_rcu(&orig_entry->list);
1069 batadv_tt_orig_list_entry_free_ref(orig_entry); 1062 batadv_tt_orig_list_entry_free_ref(orig_entry);
1070 } 1063 }
1071 spin_unlock_bh(&tt_global_entry->list_lock); 1064 spin_unlock_bh(&tt_global_entry->list_lock);
@@ -1078,18 +1071,18 @@ batadv_tt_global_del_orig_entry(struct batadv_priv *bat_priv,
1078 const char *message) 1071 const char *message)
1079{ 1072{
1080 struct hlist_head *head; 1073 struct hlist_head *head;
1081 struct hlist_node *node, *safe; 1074 struct hlist_node *safe;
1082 struct batadv_tt_orig_list_entry *orig_entry; 1075 struct batadv_tt_orig_list_entry *orig_entry;
1083 1076
1084 spin_lock_bh(&tt_global_entry->list_lock); 1077 spin_lock_bh(&tt_global_entry->list_lock);
1085 head = &tt_global_entry->orig_list; 1078 head = &tt_global_entry->orig_list;
1086 hlist_for_each_entry_safe(orig_entry, node, safe, head, list) { 1079 hlist_for_each_entry_safe(orig_entry, safe, head, list) {
1087 if (orig_entry->orig_node == orig_node) { 1080 if (orig_entry->orig_node == orig_node) {
1088 batadv_dbg(BATADV_DBG_TT, bat_priv, 1081 batadv_dbg(BATADV_DBG_TT, bat_priv,
1089 "Deleting %pM from global tt entry %pM: %s\n", 1082 "Deleting %pM from global tt entry %pM: %s\n",
1090 orig_node->orig, 1083 orig_node->orig,
1091 tt_global_entry->common.addr, message); 1084 tt_global_entry->common.addr, message);
1092 hlist_del_rcu(node); 1085 hlist_del_rcu(&orig_entry->list);
1093 batadv_tt_orig_list_entry_free_ref(orig_entry); 1086 batadv_tt_orig_list_entry_free_ref(orig_entry);
1094 } 1087 }
1095 } 1088 }
@@ -1108,7 +1101,6 @@ batadv_tt_global_del_roaming(struct batadv_priv *bat_priv,
1108{ 1101{
1109 bool last_entry = true; 1102 bool last_entry = true;
1110 struct hlist_head *head; 1103 struct hlist_head *head;
1111 struct hlist_node *node;
1112 struct batadv_tt_orig_list_entry *orig_entry; 1104 struct batadv_tt_orig_list_entry *orig_entry;
1113 1105
1114 /* no local entry exists, case 1: 1106 /* no local entry exists, case 1:
@@ -1117,7 +1109,7 @@ batadv_tt_global_del_roaming(struct batadv_priv *bat_priv,
1117 1109
1118 rcu_read_lock(); 1110 rcu_read_lock();
1119 head = &tt_global_entry->orig_list; 1111 head = &tt_global_entry->orig_list;
1120 hlist_for_each_entry_rcu(orig_entry, node, head, list) { 1112 hlist_for_each_entry_rcu(orig_entry, head, list) {
1121 if (orig_entry->orig_node != orig_node) { 1113 if (orig_entry->orig_node != orig_node) {
1122 last_entry = false; 1114 last_entry = false;
1123 break; 1115 break;
@@ -1202,7 +1194,7 @@ void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
1202 struct batadv_tt_common_entry *tt_common_entry; 1194 struct batadv_tt_common_entry *tt_common_entry;
1203 uint32_t i; 1195 uint32_t i;
1204 struct batadv_hashtable *hash = bat_priv->tt.global_hash; 1196 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
1205 struct hlist_node *node, *safe; 1197 struct hlist_node *safe;
1206 struct hlist_head *head; 1198 struct hlist_head *head;
1207 spinlock_t *list_lock; /* protects write access to the hash lists */ 1199 spinlock_t *list_lock; /* protects write access to the hash lists */
1208 1200
@@ -1214,7 +1206,7 @@ void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
1214 list_lock = &hash->list_locks[i]; 1206 list_lock = &hash->list_locks[i];
1215 1207
1216 spin_lock_bh(list_lock); 1208 spin_lock_bh(list_lock);
1217 hlist_for_each_entry_safe(tt_common_entry, node, safe, 1209 hlist_for_each_entry_safe(tt_common_entry, safe,
1218 head, hash_entry) { 1210 head, hash_entry) {
1219 tt_global = container_of(tt_common_entry, 1211 tt_global = container_of(tt_common_entry,
1220 struct batadv_tt_global_entry, 1212 struct batadv_tt_global_entry,
@@ -1227,7 +1219,7 @@ void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
1227 batadv_dbg(BATADV_DBG_TT, bat_priv, 1219 batadv_dbg(BATADV_DBG_TT, bat_priv,
1228 "Deleting global tt entry %pM: %s\n", 1220 "Deleting global tt entry %pM: %s\n",
1229 tt_global->common.addr, message); 1221 tt_global->common.addr, message);
1230 hlist_del_rcu(node); 1222 hlist_del_rcu(&tt_common_entry->hash_entry);
1231 batadv_tt_global_entry_free_ref(tt_global); 1223 batadv_tt_global_entry_free_ref(tt_global);
1232 } 1224 }
1233 } 1225 }
@@ -1262,7 +1254,7 @@ static void batadv_tt_global_purge(struct batadv_priv *bat_priv)
1262{ 1254{
1263 struct batadv_hashtable *hash = bat_priv->tt.global_hash; 1255 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
1264 struct hlist_head *head; 1256 struct hlist_head *head;
1265 struct hlist_node *node, *node_tmp; 1257 struct hlist_node *node_tmp;
1266 spinlock_t *list_lock; /* protects write access to the hash lists */ 1258 spinlock_t *list_lock; /* protects write access to the hash lists */
1267 uint32_t i; 1259 uint32_t i;
1268 char *msg = NULL; 1260 char *msg = NULL;
@@ -1274,7 +1266,7 @@ static void batadv_tt_global_purge(struct batadv_priv *bat_priv)
1274 list_lock = &hash->list_locks[i]; 1266 list_lock = &hash->list_locks[i];
1275 1267
1276 spin_lock_bh(list_lock); 1268 spin_lock_bh(list_lock);
1277 hlist_for_each_entry_safe(tt_common, node, node_tmp, head, 1269 hlist_for_each_entry_safe(tt_common, node_tmp, head,
1278 hash_entry) { 1270 hash_entry) {
1279 tt_global = container_of(tt_common, 1271 tt_global = container_of(tt_common,
1280 struct batadv_tt_global_entry, 1272 struct batadv_tt_global_entry,
@@ -1287,7 +1279,7 @@ static void batadv_tt_global_purge(struct batadv_priv *bat_priv)
1287 "Deleting global tt entry (%pM): %s\n", 1279 "Deleting global tt entry (%pM): %s\n",
1288 tt_global->common.addr, msg); 1280 tt_global->common.addr, msg);
1289 1281
1290 hlist_del_rcu(node); 1282 hlist_del_rcu(&tt_common->hash_entry);
1291 1283
1292 batadv_tt_global_entry_free_ref(tt_global); 1284 batadv_tt_global_entry_free_ref(tt_global);
1293 } 1285 }
@@ -1301,7 +1293,7 @@ static void batadv_tt_global_table_free(struct batadv_priv *bat_priv)
1301 spinlock_t *list_lock; /* protects write access to the hash lists */ 1293 spinlock_t *list_lock; /* protects write access to the hash lists */
1302 struct batadv_tt_common_entry *tt_common_entry; 1294 struct batadv_tt_common_entry *tt_common_entry;
1303 struct batadv_tt_global_entry *tt_global; 1295 struct batadv_tt_global_entry *tt_global;
1304 struct hlist_node *node, *node_tmp; 1296 struct hlist_node *node_tmp;
1305 struct hlist_head *head; 1297 struct hlist_head *head;
1306 uint32_t i; 1298 uint32_t i;
1307 1299
@@ -1315,9 +1307,9 @@ static void batadv_tt_global_table_free(struct batadv_priv *bat_priv)
1315 list_lock = &hash->list_locks[i]; 1307 list_lock = &hash->list_locks[i];
1316 1308
1317 spin_lock_bh(list_lock); 1309 spin_lock_bh(list_lock);
1318 hlist_for_each_entry_safe(tt_common_entry, node, node_tmp, 1310 hlist_for_each_entry_safe(tt_common_entry, node_tmp,
1319 head, hash_entry) { 1311 head, hash_entry) {
1320 hlist_del_rcu(node); 1312 hlist_del_rcu(&tt_common_entry->hash_entry);
1321 tt_global = container_of(tt_common_entry, 1313 tt_global = container_of(tt_common_entry,
1322 struct batadv_tt_global_entry, 1314 struct batadv_tt_global_entry,
1323 common); 1315 common);
@@ -1397,7 +1389,6 @@ static uint16_t batadv_tt_global_crc(struct batadv_priv *bat_priv,
1397 struct batadv_hashtable *hash = bat_priv->tt.global_hash; 1389 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
1398 struct batadv_tt_common_entry *tt_common; 1390 struct batadv_tt_common_entry *tt_common;
1399 struct batadv_tt_global_entry *tt_global; 1391 struct batadv_tt_global_entry *tt_global;
1400 struct hlist_node *node;
1401 struct hlist_head *head; 1392 struct hlist_head *head;
1402 uint32_t i; 1393 uint32_t i;
1403 int j; 1394 int j;
@@ -1406,7 +1397,7 @@ static uint16_t batadv_tt_global_crc(struct batadv_priv *bat_priv,
1406 head = &hash->table[i]; 1397 head = &hash->table[i];
1407 1398
1408 rcu_read_lock(); 1399 rcu_read_lock();
1409 hlist_for_each_entry_rcu(tt_common, node, head, hash_entry) { 1400 hlist_for_each_entry_rcu(tt_common, head, hash_entry) {
1410 tt_global = container_of(tt_common, 1401 tt_global = container_of(tt_common,
1411 struct batadv_tt_global_entry, 1402 struct batadv_tt_global_entry,
1412 common); 1403 common);
@@ -1449,7 +1440,6 @@ static uint16_t batadv_tt_local_crc(struct batadv_priv *bat_priv)
1449 uint16_t total = 0, total_one; 1440 uint16_t total = 0, total_one;
1450 struct batadv_hashtable *hash = bat_priv->tt.local_hash; 1441 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
1451 struct batadv_tt_common_entry *tt_common; 1442 struct batadv_tt_common_entry *tt_common;
1452 struct hlist_node *node;
1453 struct hlist_head *head; 1443 struct hlist_head *head;
1454 uint32_t i; 1444 uint32_t i;
1455 int j; 1445 int j;
@@ -1458,7 +1448,7 @@ static uint16_t batadv_tt_local_crc(struct batadv_priv *bat_priv)
1458 head = &hash->table[i]; 1448 head = &hash->table[i];
1459 1449
1460 rcu_read_lock(); 1450 rcu_read_lock();
1461 hlist_for_each_entry_rcu(tt_common, node, head, hash_entry) { 1451 hlist_for_each_entry_rcu(tt_common, head, hash_entry) {
1462 /* not yet committed clients have not to be taken into 1452 /* not yet committed clients have not to be taken into
1463 * account while computing the CRC 1453 * account while computing the CRC
1464 */ 1454 */
@@ -1597,7 +1587,6 @@ batadv_tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
1597 struct batadv_tt_common_entry *tt_common_entry; 1587 struct batadv_tt_common_entry *tt_common_entry;
1598 struct batadv_tt_query_packet *tt_response; 1588 struct batadv_tt_query_packet *tt_response;
1599 struct batadv_tt_change *tt_change; 1589 struct batadv_tt_change *tt_change;
1600 struct hlist_node *node;
1601 struct hlist_head *head; 1590 struct hlist_head *head;
1602 struct sk_buff *skb = NULL; 1591 struct sk_buff *skb = NULL;
1603 uint16_t tt_tot, tt_count; 1592 uint16_t tt_tot, tt_count;
@@ -1627,7 +1616,7 @@ batadv_tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
1627 for (i = 0; i < hash->size; i++) { 1616 for (i = 0; i < hash->size; i++) {
1628 head = &hash->table[i]; 1617 head = &hash->table[i];
1629 1618
1630 hlist_for_each_entry_rcu(tt_common_entry, node, 1619 hlist_for_each_entry_rcu(tt_common_entry,
1631 head, hash_entry) { 1620 head, hash_entry) {
1632 if (tt_count == tt_tot) 1621 if (tt_count == tt_tot)
1633 break; 1622 break;
@@ -2307,7 +2296,6 @@ static uint16_t batadv_tt_set_flags(struct batadv_hashtable *hash,
2307 uint32_t i; 2296 uint32_t i;
2308 uint16_t changed_num = 0; 2297 uint16_t changed_num = 0;
2309 struct hlist_head *head; 2298 struct hlist_head *head;
2310 struct hlist_node *node;
2311 struct batadv_tt_common_entry *tt_common_entry; 2299 struct batadv_tt_common_entry *tt_common_entry;
2312 2300
2313 if (!hash) 2301 if (!hash)
@@ -2317,7 +2305,7 @@ static uint16_t batadv_tt_set_flags(struct batadv_hashtable *hash,
2317 head = &hash->table[i]; 2305 head = &hash->table[i];
2318 2306
2319 rcu_read_lock(); 2307 rcu_read_lock();
2320 hlist_for_each_entry_rcu(tt_common_entry, node, 2308 hlist_for_each_entry_rcu(tt_common_entry,
2321 head, hash_entry) { 2309 head, hash_entry) {
2322 if (enable) { 2310 if (enable) {
2323 if ((tt_common_entry->flags & flags) == flags) 2311 if ((tt_common_entry->flags & flags) == flags)
@@ -2342,7 +2330,7 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
2342 struct batadv_hashtable *hash = bat_priv->tt.local_hash; 2330 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
2343 struct batadv_tt_common_entry *tt_common; 2331 struct batadv_tt_common_entry *tt_common;
2344 struct batadv_tt_local_entry *tt_local; 2332 struct batadv_tt_local_entry *tt_local;
2345 struct hlist_node *node, *node_tmp; 2333 struct hlist_node *node_tmp;
2346 struct hlist_head *head; 2334 struct hlist_head *head;
2347 spinlock_t *list_lock; /* protects write access to the hash lists */ 2335 spinlock_t *list_lock; /* protects write access to the hash lists */
2348 uint32_t i; 2336 uint32_t i;
@@ -2355,7 +2343,7 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
2355 list_lock = &hash->list_locks[i]; 2343 list_lock = &hash->list_locks[i];
2356 2344
2357 spin_lock_bh(list_lock); 2345 spin_lock_bh(list_lock);
2358 hlist_for_each_entry_safe(tt_common, node, node_tmp, head, 2346 hlist_for_each_entry_safe(tt_common, node_tmp, head,
2359 hash_entry) { 2347 hash_entry) {
2360 if (!(tt_common->flags & BATADV_TT_CLIENT_PENDING)) 2348 if (!(tt_common->flags & BATADV_TT_CLIENT_PENDING))
2361 continue; 2349 continue;
@@ -2365,7 +2353,7 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
2365 tt_common->addr); 2353 tt_common->addr);
2366 2354
2367 atomic_dec(&bat_priv->tt.local_entry_num); 2355 atomic_dec(&bat_priv->tt.local_entry_num);
2368 hlist_del_rcu(node); 2356 hlist_del_rcu(&tt_common->hash_entry);
2369 tt_local = container_of(tt_common, 2357 tt_local = container_of(tt_common,
2370 struct batadv_tt_local_entry, 2358 struct batadv_tt_local_entry,
2371 common); 2359 common);
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index 22d2785177d1..c053244b97bd 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -97,7 +97,6 @@ batadv_vis_hash_find(struct batadv_priv *bat_priv, const void *data)
97{ 97{
98 struct batadv_hashtable *hash = bat_priv->vis.hash; 98 struct batadv_hashtable *hash = bat_priv->vis.hash;
99 struct hlist_head *head; 99 struct hlist_head *head;
100 struct hlist_node *node;
101 struct batadv_vis_info *vis_info, *vis_info_tmp = NULL; 100 struct batadv_vis_info *vis_info, *vis_info_tmp = NULL;
102 uint32_t index; 101 uint32_t index;
103 102
@@ -108,8 +107,8 @@ batadv_vis_hash_find(struct batadv_priv *bat_priv, const void *data)
108 head = &hash->table[index]; 107 head = &hash->table[index];
109 108
110 rcu_read_lock(); 109 rcu_read_lock();
111 hlist_for_each_entry_rcu(vis_info, node, head, hash_entry) { 110 hlist_for_each_entry_rcu(vis_info, head, hash_entry) {
112 if (!batadv_vis_info_cmp(node, data)) 111 if (!batadv_vis_info_cmp(&vis_info->hash_entry, data))
113 continue; 112 continue;
114 113
115 vis_info_tmp = vis_info; 114 vis_info_tmp = vis_info;
@@ -128,9 +127,8 @@ static void batadv_vis_data_insert_interface(const uint8_t *interface,
128 bool primary) 127 bool primary)
129{ 128{
130 struct batadv_vis_if_list_entry *entry; 129 struct batadv_vis_if_list_entry *entry;
131 struct hlist_node *pos;
132 130
133 hlist_for_each_entry(entry, pos, if_list, list) { 131 hlist_for_each_entry(entry, if_list, list) {
134 if (batadv_compare_eth(entry->addr, interface)) 132 if (batadv_compare_eth(entry->addr, interface))
135 return; 133 return;
136 } 134 }
@@ -148,9 +146,8 @@ static void batadv_vis_data_read_prim_sec(struct seq_file *seq,
148 const struct hlist_head *if_list) 146 const struct hlist_head *if_list)
149{ 147{
150 struct batadv_vis_if_list_entry *entry; 148 struct batadv_vis_if_list_entry *entry;
151 struct hlist_node *pos;
152 149
153 hlist_for_each_entry(entry, pos, if_list, list) { 150 hlist_for_each_entry(entry, if_list, list) {
154 if (entry->primary) 151 if (entry->primary)
155 seq_printf(seq, "PRIMARY, "); 152 seq_printf(seq, "PRIMARY, ");
156 else 153 else
@@ -198,9 +195,8 @@ static void batadv_vis_data_read_entries(struct seq_file *seq,
198{ 195{
199 int i; 196 int i;
200 struct batadv_vis_if_list_entry *entry; 197 struct batadv_vis_if_list_entry *entry;
201 struct hlist_node *pos;
202 198
203 hlist_for_each_entry(entry, pos, list, list) { 199 hlist_for_each_entry(entry, list, list) {
204 seq_printf(seq, "%pM,", entry->addr); 200 seq_printf(seq, "%pM,", entry->addr);
205 201
206 for (i = 0; i < packet->entries; i++) 202 for (i = 0; i < packet->entries; i++)
@@ -218,17 +214,16 @@ static void batadv_vis_data_read_entries(struct seq_file *seq,
218static void batadv_vis_seq_print_text_bucket(struct seq_file *seq, 214static void batadv_vis_seq_print_text_bucket(struct seq_file *seq,
219 const struct hlist_head *head) 215 const struct hlist_head *head)
220{ 216{
221 struct hlist_node *node;
222 struct batadv_vis_info *info; 217 struct batadv_vis_info *info;
223 struct batadv_vis_packet *packet; 218 struct batadv_vis_packet *packet;
224 uint8_t *entries_pos; 219 uint8_t *entries_pos;
225 struct batadv_vis_info_entry *entries; 220 struct batadv_vis_info_entry *entries;
226 struct batadv_vis_if_list_entry *entry; 221 struct batadv_vis_if_list_entry *entry;
227 struct hlist_node *pos, *n; 222 struct hlist_node *n;
228 223
229 HLIST_HEAD(vis_if_list); 224 HLIST_HEAD(vis_if_list);
230 225
231 hlist_for_each_entry_rcu(info, node, head, hash_entry) { 226 hlist_for_each_entry_rcu(info, head, hash_entry) {
232 packet = (struct batadv_vis_packet *)info->skb_packet->data; 227 packet = (struct batadv_vis_packet *)info->skb_packet->data;
233 entries_pos = (uint8_t *)packet + sizeof(*packet); 228 entries_pos = (uint8_t *)packet + sizeof(*packet);
234 entries = (struct batadv_vis_info_entry *)entries_pos; 229 entries = (struct batadv_vis_info_entry *)entries_pos;
@@ -240,7 +235,7 @@ static void batadv_vis_seq_print_text_bucket(struct seq_file *seq,
240 batadv_vis_data_read_entries(seq, &vis_if_list, packet, 235 batadv_vis_data_read_entries(seq, &vis_if_list, packet,
241 entries); 236 entries);
242 237
243 hlist_for_each_entry_safe(entry, pos, n, &vis_if_list, list) { 238 hlist_for_each_entry_safe(entry, n, &vis_if_list, list) {
244 hlist_del(&entry->list); 239 hlist_del(&entry->list);
245 kfree(entry); 240 kfree(entry);
246 } 241 }
@@ -519,7 +514,6 @@ static int batadv_find_best_vis_server(struct batadv_priv *bat_priv,
519{ 514{
520 struct batadv_hashtable *hash = bat_priv->orig_hash; 515 struct batadv_hashtable *hash = bat_priv->orig_hash;
521 struct batadv_neigh_node *router; 516 struct batadv_neigh_node *router;
522 struct hlist_node *node;
523 struct hlist_head *head; 517 struct hlist_head *head;
524 struct batadv_orig_node *orig_node; 518 struct batadv_orig_node *orig_node;
525 struct batadv_vis_packet *packet; 519 struct batadv_vis_packet *packet;
@@ -532,7 +526,7 @@ static int batadv_find_best_vis_server(struct batadv_priv *bat_priv,
532 head = &hash->table[i]; 526 head = &hash->table[i];
533 527
534 rcu_read_lock(); 528 rcu_read_lock();
535 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 529 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
536 router = batadv_orig_node_get_router(orig_node); 530 router = batadv_orig_node_get_router(orig_node);
537 if (!router) 531 if (!router)
538 continue; 532 continue;
@@ -571,7 +565,6 @@ static bool batadv_vis_packet_full(const struct batadv_vis_info *info)
571static int batadv_generate_vis_packet(struct batadv_priv *bat_priv) 565static int batadv_generate_vis_packet(struct batadv_priv *bat_priv)
572{ 566{
573 struct batadv_hashtable *hash = bat_priv->orig_hash; 567 struct batadv_hashtable *hash = bat_priv->orig_hash;
574 struct hlist_node *node;
575 struct hlist_head *head; 568 struct hlist_head *head;
576 struct batadv_orig_node *orig_node; 569 struct batadv_orig_node *orig_node;
577 struct batadv_neigh_node *router; 570 struct batadv_neigh_node *router;
@@ -605,7 +598,7 @@ static int batadv_generate_vis_packet(struct batadv_priv *bat_priv)
605 head = &hash->table[i]; 598 head = &hash->table[i];
606 599
607 rcu_read_lock(); 600 rcu_read_lock();
608 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 601 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
609 router = batadv_orig_node_get_router(orig_node); 602 router = batadv_orig_node_get_router(orig_node);
610 if (!router) 603 if (!router)
611 continue; 604 continue;
@@ -644,7 +637,7 @@ next:
644 head = &hash->table[i]; 637 head = &hash->table[i];
645 638
646 rcu_read_lock(); 639 rcu_read_lock();
647 hlist_for_each_entry_rcu(tt_common_entry, node, head, 640 hlist_for_each_entry_rcu(tt_common_entry, head,
648 hash_entry) { 641 hash_entry) {
649 packet_pos = skb_put(info->skb_packet, sizeof(*entry)); 642 packet_pos = skb_put(info->skb_packet, sizeof(*entry));
650 entry = (struct batadv_vis_info_entry *)packet_pos; 643 entry = (struct batadv_vis_info_entry *)packet_pos;
@@ -673,14 +666,14 @@ static void batadv_purge_vis_packets(struct batadv_priv *bat_priv)
673{ 666{
674 uint32_t i; 667 uint32_t i;
675 struct batadv_hashtable *hash = bat_priv->vis.hash; 668 struct batadv_hashtable *hash = bat_priv->vis.hash;
676 struct hlist_node *node, *node_tmp; 669 struct hlist_node *node_tmp;
677 struct hlist_head *head; 670 struct hlist_head *head;
678 struct batadv_vis_info *info; 671 struct batadv_vis_info *info;
679 672
680 for (i = 0; i < hash->size; i++) { 673 for (i = 0; i < hash->size; i++) {
681 head = &hash->table[i]; 674 head = &hash->table[i];
682 675
683 hlist_for_each_entry_safe(info, node, node_tmp, 676 hlist_for_each_entry_safe(info, node_tmp,
684 head, hash_entry) { 677 head, hash_entry) {
685 /* never purge own data. */ 678 /* never purge own data. */
686 if (info == bat_priv->vis.my_info) 679 if (info == bat_priv->vis.my_info)
@@ -688,7 +681,7 @@ static void batadv_purge_vis_packets(struct batadv_priv *bat_priv)
688 681
689 if (batadv_has_timed_out(info->first_seen, 682 if (batadv_has_timed_out(info->first_seen,
690 BATADV_VIS_TIMEOUT)) { 683 BATADV_VIS_TIMEOUT)) {
691 hlist_del(node); 684 hlist_del(&info->hash_entry);
692 batadv_send_list_del(info); 685 batadv_send_list_del(info);
693 kref_put(&info->refcount, batadv_free_info); 686 kref_put(&info->refcount, batadv_free_info);
694 } 687 }
@@ -700,7 +693,6 @@ static void batadv_broadcast_vis_packet(struct batadv_priv *bat_priv,
700 struct batadv_vis_info *info) 693 struct batadv_vis_info *info)
701{ 694{
702 struct batadv_hashtable *hash = bat_priv->orig_hash; 695 struct batadv_hashtable *hash = bat_priv->orig_hash;
703 struct hlist_node *node;
704 struct hlist_head *head; 696 struct hlist_head *head;
705 struct batadv_orig_node *orig_node; 697 struct batadv_orig_node *orig_node;
706 struct batadv_vis_packet *packet; 698 struct batadv_vis_packet *packet;
@@ -715,7 +707,7 @@ static void batadv_broadcast_vis_packet(struct batadv_priv *bat_priv,
715 head = &hash->table[i]; 707 head = &hash->table[i];
716 708
717 rcu_read_lock(); 709 rcu_read_lock();
718 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 710 hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
719 /* if it's a vis server and reachable, send it. */ 711 /* if it's a vis server and reachable, send it. */
720 if (!(orig_node->flags & BATADV_VIS_SERVER)) 712 if (!(orig_node->flags & BATADV_VIS_SERVER))
721 continue; 713 continue;