Skip to content

Commit

Permalink
net_sched: constify qdisc_priv()
Browse files Browse the repository at this point in the history
In order to propagate const qualifiers, we change qdisc_priv()
to accept a possibly const argument.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 1, 2023
1 parent 66ac08a commit 1add907
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/net/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ struct qdisc_walker {
int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *);
};

static inline void *qdisc_priv(struct Qdisc *q)
{
return &q->privdata;
}
#define qdisc_priv(q) \
_Generic(q, \
const struct Qdisc * : (const void *)&q->privdata, \
struct Qdisc * : (void *)&q->privdata)

static inline struct Qdisc *qdisc_from_priv(void *priv)
{
Expand Down

0 comments on commit 1add907

Please sign in to comment.