Commit 1add9073 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net_sched: constify qdisc_priv()

In order to propagate const qualifiers, we change qdisc_priv()
to accept a possibly const argument.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 66ac08a7
...@@ -20,10 +20,10 @@ struct qdisc_walker { ...@@ -20,10 +20,10 @@ struct qdisc_walker {
int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *); int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *);
}; };
static inline void *qdisc_priv(struct Qdisc *q) #define qdisc_priv(q) \
{ _Generic(q, \
return &q->privdata; const struct Qdisc * : (const void *)&q->privdata, \
} struct Qdisc * : (void *)&q->privdata)
static inline struct Qdisc *qdisc_from_priv(void *priv) static inline struct Qdisc *qdisc_from_priv(void *priv)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment