On Thu, 2014-09-18 at 11:07 -0700, Joe Perches wrote:
quoted
+static inline struct ipoib_cb *ipoib_skb_cb(const struct sk_buff *skb)
+{
+ BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct ipoib_cb));
+ return (struct ipoib_cb *)skb->cb;
+}
It seems better not to use const for the struct sk_buff * here.
Neither of the uses take a const struct sk_buff *
Thats pretty standard, check for other similar constructs like that.
static inline struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb)
{
return (struct qdisc_skb_cb *)skb->cb;
}
This allows uses of the helper when the skb is only read (has the const qual)