Skip to content

Commit da64119

Browse files
ecsvAntonio Quartulli
authored andcommitted
batman-adv: Prefix originator static inline functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
1 parent c0a5592 commit da64119

8 files changed

Lines changed: 37 additions & 32 deletions

File tree

‎net/batman-adv/bridge_loop_avoidance.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv,
390390
}
391391

392392
/* this is a gateway now, remove any tt entries */
393-
orig_node = orig_hash_find(bat_priv, orig);
393+
orig_node = batadv_orig_hash_find(bat_priv, orig);
394394
if (orig_node) {
395395
batadv_tt_global_del_orig(bat_priv, orig_node,
396396
"became a backbone gateway");
@@ -780,7 +780,7 @@ static int check_claim_group(struct bat_priv *bat_priv,
780780
return 2;
781781

782782
/* lets see if this originator is in our mesh */
783-
orig_node = orig_hash_find(bat_priv, backbone_addr);
783+
orig_node = batadv_orig_hash_find(bat_priv, backbone_addr);
784784

785785
/* dont accept claims from gateways which are not in
786786
* the same mesh or group.

‎net/batman-adv/icmp_socket.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
213213
if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE)
214214
goto dst_unreach;
215215

216-
orig_node = orig_hash_find(bat_priv, icmp_packet->dst);
216+
orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst);
217217
if (!orig_node)
218218
goto dst_unreach;
219219

‎net/batman-adv/originator.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
195195
int size;
196196
int hash_added;
197197

198-
orig_node = orig_hash_find(bat_priv, addr);
198+
orig_node = batadv_orig_hash_find(bat_priv, addr);
199199
if (orig_node)
200200
return orig_node;
201201

@@ -249,7 +249,7 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
249249
goto free_bcast_own;
250250

251251
hash_added = batadv_hash_add(bat_priv->orig_hash, compare_orig,
252-
choose_orig, orig_node,
252+
batadv_choose_orig, orig_node,
253253
&orig_node->hash_entry);
254254
if (hash_added != 0)
255255
goto free_bcast_own_sum;

‎net/batman-adv/originator.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
4141
/* hashfunction to choose an entry in a hash table of given size
4242
* hash algorithm from http://en.wikipedia.org/wiki/Hash_table
4343
*/
44-
static inline uint32_t choose_orig(const void *data, uint32_t size)
44+
static inline uint32_t batadv_choose_orig(const void *data, uint32_t size)
4545
{
4646
const unsigned char *key = data;
4747
uint32_t hash = 0;
@@ -60,8 +60,8 @@ static inline uint32_t choose_orig(const void *data, uint32_t size)
6060
return hash % size;
6161
}
6262

63-
static inline struct orig_node *orig_hash_find(struct bat_priv *bat_priv,
64-
const void *data)
63+
static inline struct orig_node *batadv_orig_hash_find(struct bat_priv *bat_priv,
64+
const void *data)
6565
{
6666
struct hashtable_t *hash = bat_priv->orig_hash;
6767
struct hlist_head *head;
@@ -72,7 +72,7 @@ static inline struct orig_node *orig_hash_find(struct bat_priv *bat_priv,
7272
if (!hash)
7373
return NULL;
7474

75-
index = choose_orig(data, hash->size);
75+
index = batadv_choose_orig(data, hash->size);
7676
head = &hash->table[index];
7777

7878
rcu_read_lock();

‎net/batman-adv/routing.c‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
298298

299299
/* answer echo request (ping) */
300300
/* get routing information */
301-
orig_node = orig_hash_find(bat_priv, icmp_packet->orig);
301+
orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->orig);
302302
if (!orig_node)
303303
goto out;
304304

@@ -353,7 +353,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
353353
goto out;
354354

355355
/* get routing information */
356-
orig_node = orig_hash_find(bat_priv, icmp_packet->orig);
356+
orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->orig);
357357
if (!orig_node)
358358
goto out;
359359

@@ -437,7 +437,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
437437
return recv_icmp_ttl_exceeded(bat_priv, skb);
438438

439439
/* get routing information */
440-
orig_node = orig_hash_find(bat_priv, icmp_packet->dst);
440+
orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst);
441441
if (!orig_node)
442442
goto out;
443443

@@ -684,7 +684,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
684684
if (batadv_bla_is_backbone_gw_orig(bat_priv, roam_adv_packet->src))
685685
goto out;
686686

687-
orig_node = orig_hash_find(bat_priv, roam_adv_packet->src);
687+
orig_node = batadv_orig_hash_find(bat_priv, roam_adv_packet->src);
688688
if (!orig_node)
689689
goto out;
690690

@@ -721,6 +721,7 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
721721
struct neigh_node *router;
722722
static uint8_t zero_mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
723723
int bonding_enabled;
724+
uint8_t *primary_addr;
724725

725726
if (!orig_node)
726727
return NULL;
@@ -743,20 +744,22 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
743744
if ((!recv_if) && (!bonding_enabled))
744745
goto return_router;
745746

747+
primary_addr = router_orig->primary_addr;
748+
746749
/* if we have something in the primary_addr, we can search
747750
* for a potential bonding candidate.
748751
*/
749-
if (compare_eth(router_orig->primary_addr, zero_mac))
752+
if (compare_eth(primary_addr, zero_mac))
750753
goto return_router;
751754

752755
/* find the orig_node which has the primary interface. might
753756
* even be the same as our router_orig in many cases
754757
*/
755-
if (compare_eth(router_orig->primary_addr, router_orig->orig)) {
758+
if (compare_eth(primary_addr, router_orig->orig)) {
756759
primary_orig_node = router_orig;
757760
} else {
758-
primary_orig_node = orig_hash_find(bat_priv,
759-
router_orig->primary_addr);
761+
primary_orig_node = batadv_orig_hash_find(bat_priv,
762+
primary_addr);
760763
if (!primary_orig_node)
761764
goto return_router;
762765

@@ -839,7 +842,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
839842
}
840843

841844
/* get routing information */
842-
orig_node = orig_hash_find(bat_priv, unicast_packet->dest);
845+
orig_node = batadv_orig_hash_find(bat_priv, unicast_packet->dest);
843846

844847
if (!orig_node)
845848
goto out;
@@ -922,7 +925,8 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
922925
tt_poss_change = bat_priv->tt_poss_change;
923926
curr_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn);
924927
} else {
925-
orig_node = orig_hash_find(bat_priv, unicast_packet->dest);
928+
orig_node = batadv_orig_hash_find(bat_priv,
929+
unicast_packet->dest);
926930

927931
if (!orig_node)
928932
return 0;
@@ -1078,7 +1082,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
10781082
if (bcast_packet->header.ttl < 2)
10791083
goto out;
10801084

1081-
orig_node = orig_hash_find(bat_priv, bcast_packet->orig);
1085+
orig_node = batadv_orig_hash_find(bat_priv, bcast_packet->orig);
10821086

10831087
if (!orig_node)
10841088
goto out;

‎net/batman-adv/translation-table.c‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static struct tt_common_entry *tt_hash_find(struct hashtable_t *hash,
6161
if (!hash)
6262
return NULL;
6363

64-
index = choose_orig(data, hash->size);
64+
index = batadv_choose_orig(data, hash->size);
6565
head = &hash->table[index];
6666

6767
rcu_read_lock();
@@ -235,7 +235,8 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
235235
tt_local_entry->common.flags |= TT_CLIENT_NEW;
236236

237237
hash_added = batadv_hash_add(bat_priv->tt_local_hash, compare_tt,
238-
choose_orig, &tt_local_entry->common,
238+
batadv_choose_orig,
239+
&tt_local_entry->common,
239240
&tt_local_entry->common.hash_entry);
240241

241242
if (unlikely(hash_added != 0)) {
@@ -639,7 +640,7 @@ int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
639640
spin_lock_init(&tt_global_entry->list_lock);
640641

641642
hash_added = batadv_hash_add(bat_priv->tt_global_hash,
642-
compare_tt, choose_orig,
643+
compare_tt, batadv_choose_orig,
643644
common, &common->hash_entry);
644645

645646
if (unlikely(hash_added != 0)) {
@@ -818,8 +819,8 @@ static void tt_global_del_struct(struct bat_priv *bat_priv,
818819
"Deleting global tt entry %pM: %s\n",
819820
tt_global_entry->common.addr, message);
820821

821-
batadv_hash_remove(bat_priv->tt_global_hash, compare_tt, choose_orig,
822-
tt_global_entry->common.addr);
822+
batadv_hash_remove(bat_priv->tt_global_hash, compare_tt,
823+
batadv_choose_orig, tt_global_entry->common.addr);
823824
tt_global_entry_free_ref(tt_global_entry);
824825

825826
}
@@ -1454,11 +1455,11 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
14541455
(tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
14551456

14561457
/* Let's get the orig node of the REAL destination */
1457-
req_dst_orig_node = orig_hash_find(bat_priv, tt_request->dst);
1458+
req_dst_orig_node = batadv_orig_hash_find(bat_priv, tt_request->dst);
14581459
if (!req_dst_orig_node)
14591460
goto out;
14601461

1461-
res_dst_orig_node = orig_hash_find(bat_priv, tt_request->src);
1462+
res_dst_orig_node = batadv_orig_hash_find(bat_priv, tt_request->src);
14621463
if (!res_dst_orig_node)
14631464
goto out;
14641465

@@ -1586,7 +1587,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
15861587
my_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn);
15871588
req_ttvn = tt_request->ttvn;
15881589

1589-
orig_node = orig_hash_find(bat_priv, tt_request->src);
1590+
orig_node = batadv_orig_hash_find(bat_priv, tt_request->src);
15901591
if (!orig_node)
15911592
goto out;
15921593

@@ -1731,7 +1732,7 @@ static void tt_fill_gtable(struct bat_priv *bat_priv,
17311732
{
17321733
struct orig_node *orig_node = NULL;
17331734

1734-
orig_node = orig_hash_find(bat_priv, tt_response->src);
1735+
orig_node = batadv_orig_hash_find(bat_priv, tt_response->src);
17351736
if (!orig_node)
17361737
goto out;
17371738

@@ -1804,7 +1805,7 @@ void batadv_handle_tt_response(struct bat_priv *bat_priv,
18041805
if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_response->src))
18051806
goto out;
18061807

1807-
orig_node = orig_hash_find(bat_priv, tt_response->src);
1808+
orig_node = batadv_orig_hash_find(bat_priv, tt_response->src);
18081809
if (!orig_node)
18091810
goto out;
18101811

‎net/batman-adv/unicast.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
181181

182182
*new_skb = NULL;
183183

184-
orig_node = orig_hash_find(bat_priv, unicast_packet->orig);
184+
orig_node = batadv_orig_hash_find(bat_priv, unicast_packet->orig);
185185
if (!orig_node)
186186
goto out;
187187

‎net/batman-adv/vis.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ static void unicast_vis_packet(struct bat_priv *bat_priv,
803803

804804
packet = (struct vis_packet *)info->skb_packet->data;
805805

806-
orig_node = orig_hash_find(bat_priv, packet->target_orig);
806+
orig_node = batadv_orig_hash_find(bat_priv, packet->target_orig);
807807
if (!orig_node)
808808
goto out;
809809

0 commit comments

Comments
 (0)