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>
This commit is contained in:

committed by
David S. Miller

parent
cef401de7b
commit
2bf3440d7b
@@ -32,4 +32,14 @@ struct can_skb_priv {
|
||||
struct can_frame cf[0];
|
||||
};
|
||||
|
||||
static inline struct can_skb_priv *can_skb_prv(struct sk_buff *skb)
|
||||
{
|
||||
return (struct can_skb_priv *)(skb->head);
|
||||
}
|
||||
|
||||
static inline void can_skb_reserve(struct sk_buff *skb)
|
||||
{
|
||||
skb_reserve(skb, sizeof(struct can_skb_priv));
|
||||
}
|
||||
|
||||
#endif /* CAN_SKB_H */
|
||||
|
Reference in New Issue
Block a user