Thread (36 messages) flat view 36 messages, 12 authors, 2014-09-22

Re: [PATCH net] net: sched: shrink struct qdisc_skb_cb to 28 bytes

From: Eric Dumazet <hidden>
Date: 2014-09-18 19:14:52

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)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help