batman-adv: Prefix types enum with BATADV_
authorSven Eckelmann <sven@narfation.org>
Sun, 3 Jun 2012 20:19:20 +0000 (22:19 +0200)
committerAntonio Quartulli <ordex@autistici.org>
Sun, 1 Jul 2012 20:47:19 +0000 (22:47 +0200)
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/bat_iv_ogm.c
net/batman-adv/routing.c
net/batman-adv/soft-interface.c
net/batman-adv/translation-table.c
net/batman-adv/types.h

index a59e317284add53add97849bd71b7564c1ad1066..60997192c899fbdce99d87f74cd731e6e59cbf4d 100644 (file)
@@ -209,8 +209,8 @@ static void batadv_iv_ogm_send_to_if(struct forw_packet *forw_packet,
        /* create clone because function is called more than once */
        skb = skb_clone(forw_packet->skb, GFP_ATOMIC);
        if (skb) {
-               batadv_inc_counter(bat_priv, BAT_CNT_MGMT_TX);
-               batadv_add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
+               batadv_inc_counter(bat_priv, BATADV_CNT_MGMT_TX);
+               batadv_add_counter(bat_priv, BATADV_CNT_MGMT_TX_BYTES,
                                   skb->len + ETH_HLEN);
                batadv_send_skb_packet(skb, hard_iface, batadv_broadcast_addr);
        }
@@ -1256,8 +1256,8 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
        if (bat_priv->bat_algo_ops->bat_ogm_emit != batadv_iv_ogm_emit)
                return NET_RX_DROP;
 
-       batadv_inc_counter(bat_priv, BAT_CNT_MGMT_RX);
-       batadv_add_counter(bat_priv, BAT_CNT_MGMT_RX_BYTES,
+       batadv_inc_counter(bat_priv, BATADV_CNT_MGMT_RX);
+       batadv_add_counter(bat_priv, BATADV_CNT_MGMT_RX_BYTES,
                           skb->len + ETH_HLEN);
 
        packet_len = skb_headlen(skb);
index 4d632215f92f8dbff7b2c7ad8b8656c325a47406..aa8325e8f8bfb1d7f1fe72b4c761f6de0d2403b1 100644 (file)
@@ -607,7 +607,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
 
        switch (tt_query->flags & BATADV_TT_QUERY_TYPE_MASK) {
        case TT_REQUEST:
-               batadv_inc_counter(bat_priv, BAT_CNT_TT_REQUEST_RX);
+               batadv_inc_counter(bat_priv, BATADV_CNT_TT_REQUEST_RX);
 
                /* If we cannot provide an answer the tt_request is
                 * forwarded
@@ -622,7 +622,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
                }
                break;
        case TT_RESPONSE:
-               batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_RX);
+               batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_RX);
 
                if (batadv_is_my_mac(tt_query->dst)) {
                        /* packet needs to be linearized to access the TT
@@ -678,7 +678,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
        if (is_broadcast_ether_addr(ethhdr->h_source))
                goto out;
 
-       batadv_inc_counter(bat_priv, BAT_CNT_TT_ROAM_ADV_RX);
+       batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
 
        roam_adv_packet = (struct roam_adv_packet *)skb->data;
 
@@ -900,8 +900,8 @@ static int batadv_route_unicast_packet(struct sk_buff *skb,
        unicast_packet->header.ttl--;
 
        /* Update stats counter */
-       batadv_inc_counter(bat_priv, BAT_CNT_FORWARD);
-       batadv_add_counter(bat_priv, BAT_CNT_FORWARD_BYTES,
+       batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD);
+       batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES,
                           skb->len + ETH_HLEN);
 
        /* route it */
index b77e598fb2b0518e282082c8942caf41228cbe85..19a80d276585dc8a94e438b556ca3275a74e48a2 100644 (file)
@@ -366,6 +366,7 @@ struct net_device *batadv_softif_create(const char *name)
        struct net_device *soft_iface;
        struct bat_priv *bat_priv;
        int ret;
+       size_t cnt_len = sizeof(uint64_t) * BATADV_CNT_NUM;
 
        soft_iface = alloc_netdev(sizeof(*bat_priv), name,
                                  batadv_interface_setup);
@@ -411,8 +412,7 @@ struct net_device *batadv_softif_create(const char *name)
        bat_priv->primary_if = NULL;
        bat_priv->num_ifaces = 0;
 
-       bat_priv->bat_counters = __alloc_percpu(sizeof(uint64_t) * BAT_CNT_NUM,
-                                               __alignof__(uint64_t));
+       bat_priv->bat_counters = __alloc_percpu(cnt_len, __alignof__(uint64_t));
        if (!bat_priv->bat_counters)
                goto unreg_soft_iface;
 
@@ -542,14 +542,14 @@ static void batadv_get_ethtool_stats(struct net_device *dev,
        struct bat_priv *bat_priv = netdev_priv(dev);
        int i;
 
-       for (i = 0; i < BAT_CNT_NUM; i++)
+       for (i = 0; i < BATADV_CNT_NUM; i++)
                data[i] = batadv_sum_counter(bat_priv, i);
 }
 
 static int batadv_get_sset_count(struct net_device *dev, int stringset)
 {
        if (stringset == ETH_SS_STATS)
-               return BAT_CNT_NUM;
+               return BATADV_CNT_NUM;
 
        return -EOPNOTSUPP;
 }
index 156c3094c12ba51604a77b1186ad6d4374cd0cac..f36d1d52bff9c2f9885de20b7934a0e398b5a9f1 100644 (file)
@@ -1471,7 +1471,7 @@ static int batadv_send_tt_request(struct bat_priv *bat_priv,
                   dst_orig_node->orig, neigh_node->addr,
                   (full_table ? 'F' : '.'));
 
-       batadv_inc_counter(bat_priv, BAT_CNT_TT_REQUEST_TX);
+       batadv_inc_counter(bat_priv, BATADV_CNT_TT_REQUEST_TX);
 
        batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = 0;
@@ -1599,7 +1599,7 @@ static bool batadv_send_other_tt_response(struct bat_priv *bat_priv,
                   res_dst_orig_node->orig, neigh_node->addr,
                   req_dst_orig_node->orig, req_ttvn);
 
-       batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
+       batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
 
        batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = true;
@@ -1720,7 +1720,7 @@ static bool batadv_send_my_tt_response(struct bat_priv *bat_priv,
                   orig_node->orig, neigh_node->addr,
                   (tt_response->flags & TT_FULL_TABLE ? 'F' : '.'));
 
-       batadv_inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
+       batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
 
        batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = true;
@@ -2038,7 +2038,7 @@ static void batadv_send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
                   "Sending ROAMING_ADV to %pM (client %pM) via %pM\n",
                   orig_node->orig, client, neigh_node->addr);
 
-       batadv_inc_counter(bat_priv, BAT_CNT_TT_ROAM_ADV_TX);
+       batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_TX);
 
        batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
        ret = 0;
index fd538ea68117c01159528dd20d3979f7ca76c8fb..fcbac82e9c474ff8855cbe3c0e240a2b081e0c8f 100644 (file)
@@ -143,20 +143,20 @@ struct bcast_duplist_entry {
 };
 #endif
 
-enum bat_counters {
-       BAT_CNT_FORWARD,
-       BAT_CNT_FORWARD_BYTES,
-       BAT_CNT_MGMT_TX,
-       BAT_CNT_MGMT_TX_BYTES,
-       BAT_CNT_MGMT_RX,
-       BAT_CNT_MGMT_RX_BYTES,
-       BAT_CNT_TT_REQUEST_TX,
-       BAT_CNT_TT_REQUEST_RX,
-       BAT_CNT_TT_RESPONSE_TX,
-       BAT_CNT_TT_RESPONSE_RX,
-       BAT_CNT_TT_ROAM_ADV_TX,
-       BAT_CNT_TT_ROAM_ADV_RX,
-       BAT_CNT_NUM,
+enum batadv_counters {
+       BATADV_CNT_FORWARD,
+       BATADV_CNT_FORWARD_BYTES,
+       BATADV_CNT_MGMT_TX,
+       BATADV_CNT_MGMT_TX_BYTES,
+       BATADV_CNT_MGMT_RX,
+       BATADV_CNT_MGMT_RX_BYTES,
+       BATADV_CNT_TT_REQUEST_TX,
+       BATADV_CNT_TT_REQUEST_RX,
+       BATADV_CNT_TT_RESPONSE_TX,
+       BATADV_CNT_TT_RESPONSE_RX,
+       BATADV_CNT_TT_ROAM_ADV_TX,
+       BATADV_CNT_TT_ROAM_ADV_RX,
+       BATADV_CNT_NUM,
 };
 
 struct bat_priv {