From 825863408a1670035e7105368cbfe8b126290ba1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?YOSHIFUJI=20Hideaki=20/=20=E5=90=89=E8=97=A4=E8=8B=B1?= =?utf8?q?=E6=98=8E?= Date: Sat, 19 Jan 2013 22:03:07 +0000 Subject: [PATCH] firewire net: Use LL_RESERVED_SPACE(), HH_DATA_OFF(). Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- drivers/firewire/net.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index df6a1ca..2b27bff2 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -270,7 +270,7 @@ static int fwnet_header_cache(const struct neighbour *neigh, if (type == cpu_to_be16(ETH_P_802_3)) return -1; net = neigh->dev; - h = (struct fwnet_header *)((u8 *)hh->hh_data + 16 - sizeof(*h)); + h = (struct fwnet_header *)((u8 *)hh->hh_data + HH_DATA_OFF(sizeof(*h))); h->h_proto = type; memcpy(h->h_dest, neigh->ha, net->addr_len); hh->hh_len = FWNET_HLEN; @@ -282,7 +282,7 @@ static int fwnet_header_cache(const struct neighbour *neigh, static void fwnet_header_cache_update(struct hh_cache *hh, const struct net_device *net, const unsigned char *haddr) { - memcpy((u8 *)hh->hh_data + 16 - FWNET_HLEN, haddr, net->addr_len); + memcpy((u8 *)hh->hh_data + HH_DATA_OFF(FWNET_HLEN), haddr, net->addr_len); } static int fwnet_header_parse(const struct sk_buff *skb, unsigned char *haddr) @@ -398,11 +398,11 @@ static struct fwnet_partial_datagram *fwnet_pd_new(struct net_device *net, new->datagram_label = datagram_label; new->datagram_size = dg_size; - new->skb = dev_alloc_skb(dg_size + net->hard_header_len + 15); + new->skb = dev_alloc_skb(dg_size + LL_RESERVED_SPACE(net)); if (new->skb == NULL) goto fail_w_fi; - skb_reserve(new->skb, (net->hard_header_len + 15) & ~15); + skb_reserve(new->skb, LL_RESERVED_SPACE(net)); new->pbuf = skb_put(new->skb, dg_size); memcpy(new->pbuf + frag_off, frag_buf, frag_len); list_add_tail(&new->pd_link, &peer->pd_list); @@ -690,14 +690,14 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, buf++; len -= RFC2374_UNFRAG_HDR_SIZE; - skb = dev_alloc_skb(len + net->hard_header_len + 15); + skb = dev_alloc_skb(len + LL_RESERVED_SPACE(net)); if (unlikely(!skb)) { dev_err(&net->dev, "out of memory\n"); net->stats.rx_dropped++; return -ENOMEM; } - skb_reserve(skb, (net->hard_header_len + 15) & ~15); + skb_reserve(skb, LL_RESERVED_SPACE(net)); memcpy(skb_put(skb, len), buf, len); return fwnet_finish_incoming_packet(net, skb, source_node_id, -- 2.7.4