diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-02-18 05:27:34 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-04-18 03:54:01 -0400 |
commit | 0d125074ebc8c971e939f8c2c8f90a80fa09aeb4 (patch) | |
tree | fb31ee069ab0a2abc7681b999839fd81392110f7 /net/batman-adv/vis.c | |
parent | 1eeb479fda2405269b3a85c86ba0eca41fcc4ea0 (diff) |
batman-adv: use ETH_HLEN instead of sizeof(struct ethhdr)
Instead of using sizeof(struct ethhdr) it is strongly recommended to use the
kernel macro ETH_HLEN. This patch substitute each occurrence of the former
expressione with the latter one.
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/vis.c')
-rw-r--r-- | net/batman-adv/vis.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c index c4a5b8cafad..cec216fb77c 100644 --- a/net/batman-adv/vis.c +++ b/net/batman-adv/vis.c | |||
@@ -434,12 +434,12 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv, | |||
434 | return NULL; | 434 | return NULL; |
435 | 435 | ||
436 | info->skb_packet = dev_alloc_skb(sizeof(*packet) + vis_info_len + | 436 | info->skb_packet = dev_alloc_skb(sizeof(*packet) + vis_info_len + |
437 | sizeof(struct ethhdr)); | 437 | ETH_HLEN); |
438 | if (!info->skb_packet) { | 438 | if (!info->skb_packet) { |
439 | kfree(info); | 439 | kfree(info); |
440 | return NULL; | 440 | return NULL; |
441 | } | 441 | } |
442 | skb_reserve(info->skb_packet, sizeof(struct ethhdr)); | 442 | skb_reserve(info->skb_packet, ETH_HLEN); |
443 | packet = (struct vis_packet *)skb_put(info->skb_packet, sizeof(*packet) | 443 | packet = (struct vis_packet *)skb_put(info->skb_packet, sizeof(*packet) |
444 | + vis_info_len); | 444 | + vis_info_len); |
445 | 445 | ||
@@ -894,11 +894,11 @@ int vis_init(struct bat_priv *bat_priv) | |||
894 | 894 | ||
895 | bat_priv->my_vis_info->skb_packet = dev_alloc_skb(sizeof(*packet) + | 895 | bat_priv->my_vis_info->skb_packet = dev_alloc_skb(sizeof(*packet) + |
896 | MAX_VIS_PACKET_SIZE + | 896 | MAX_VIS_PACKET_SIZE + |
897 | sizeof(struct ethhdr)); | 897 | ETH_HLEN); |
898 | if (!bat_priv->my_vis_info->skb_packet) | 898 | if (!bat_priv->my_vis_info->skb_packet) |
899 | goto free_info; | 899 | goto free_info; |
900 | 900 | ||
901 | skb_reserve(bat_priv->my_vis_info->skb_packet, sizeof(struct ethhdr)); | 901 | skb_reserve(bat_priv->my_vis_info->skb_packet, ETH_HLEN); |
902 | packet = (struct vis_packet *)skb_put(bat_priv->my_vis_info->skb_packet, | 902 | packet = (struct vis_packet *)skb_put(bat_priv->my_vis_info->skb_packet, |
903 | sizeof(*packet)); | 903 | sizeof(*packet)); |
904 | 904 | ||