summaryrefslogtreecommitdiff
path: root/drivers/net/can
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2013-01-28 08:33:33 +0000
committerDavid S. Miller <davem@davemloft.net>2013-01-28 18:17:25 -0500
commit2bf3440d7b8755f2627232e6a4c37efbbe053685 (patch)
tree07e31649ec6a5d58649f6b3c9f8cd1a76e76b24f /drivers/net/can
parentcef401de7be8c4e155c6746bfccf721a4fa5fab9 (diff)
downloadlinux-3.10-2bf3440d7b8755f2627232e6a4c37efbbe053685.tar.gz
linux-3.10-2bf3440d7b8755f2627232e6a4c37efbbe053685.tar.bz2
linux-3.10-2bf3440d7b8755f2627232e6a4c37efbbe053685.zip
can: rework skb reserved data handling
Added accessor and skb_reserve helpers for struct can_skb_priv. Removed pointless skb_headroom() check. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> CC: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/dev.c4
-rw-r--r--drivers/net/can/slcan.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 59ada082a99..f9cba4123c6 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -512,8 +512,8 @@ struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf)
skb->pkt_type = PACKET_BROADCAST;
skb->ip_summed = CHECKSUM_UNNECESSARY;
- skb_reserve(skb, sizeof(struct can_skb_priv));
- ((struct can_skb_priv *)(skb->head))->ifindex = dev->ifindex;
+ can_skb_reserve(skb);
+ can_skb_prv(skb)->ifindex = dev->ifindex;
*cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
memset(*cf, 0, sizeof(struct can_frame));
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index e79a8d10e0f..06b7e097d36 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -195,8 +195,8 @@ static void slc_bump(struct slcan *sl)
skb->pkt_type = PACKET_BROADCAST;
skb->ip_summed = CHECKSUM_UNNECESSARY;
- skb_reserve(skb, sizeof(struct can_skb_priv));
- ((struct can_skb_priv *)(skb->head))->ifindex = sl->dev->ifindex;
+ can_skb_reserve(skb);
+ can_skb_prv(skb)->ifindex = sl->dev->ifindex;
memcpy(skb_put(skb, sizeof(struct can_frame)),
&cf, sizeof(struct can_frame));