aboutsummaryrefslogtreecommitdiff
path: root/net/batman-adv/vis.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-06-03 22:19:07 +0200
committerAntonio Quartulli <ordex@autistici.org>2012-06-28 08:44:53 +0200
commit347c80f0fb9adbd5f3756bd8a612664492768808 (patch)
treeeb5a95b473d056ed281eb9291861342e0c58efb6 /net/batman-adv/vis.c
parentd4f4469255359c97564b15b5ef04253fd3ec08f1 (diff)
batman-adv: Prefix local defines with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/vis.c')
-rw-r--r--net/batman-adv/vis.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index 3095c41a67a..7dc750670c3 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -26,7 +26,7 @@
#include "hash.h"
#include "originator.h"
-#define MAX_VIS_PACKET_SIZE 1000
+#define BATADV_MAX_VIS_PACKET_SIZE 1000
static void batadv_start_vis_timer(struct bat_priv *bat_priv);
@@ -544,10 +544,12 @@ static int batadv_find_best_vis_server(struct bat_priv *bat_priv,
static bool batadv_vis_packet_full(const struct vis_info *info)
{
const struct vis_packet *packet;
+ size_t num_items;
+
packet = (struct vis_packet *)info->skb_packet->data;
+ num_items = BATADV_MAX_VIS_PACKET_SIZE / sizeof(struct vis_info_entry);
- if (MAX_VIS_PACKET_SIZE / sizeof(struct vis_info_entry)
- < packet->entries + 1)
+ if (num_items < packet->entries + 1)
return true;
return false;
}
@@ -838,6 +840,7 @@ int batadv_vis_init(struct bat_priv *bat_priv)
{
struct vis_packet *packet;
int hash_added;
+ unsigned int len;
if (bat_priv->vis_hash)
return 0;
@@ -850,13 +853,12 @@ int batadv_vis_init(struct bat_priv *bat_priv)
goto err;
}
- bat_priv->my_vis_info = kmalloc(MAX_VIS_PACKET_SIZE, GFP_ATOMIC);
+ bat_priv->my_vis_info = kmalloc(BATADV_MAX_VIS_PACKET_SIZE, GFP_ATOMIC);
if (!bat_priv->my_vis_info)
goto err;
- bat_priv->my_vis_info->skb_packet = dev_alloc_skb(sizeof(*packet) +
- MAX_VIS_PACKET_SIZE +
- ETH_HLEN);
+ len = sizeof(*packet) + BATADV_MAX_VIS_PACKET_SIZE + ETH_HLEN;
+ bat_priv->my_vis_info->skb_packet = dev_alloc_skb(len);
if (!bat_priv->my_vis_info->skb_packet)
goto free_info;