summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-20 20:17:11 +0000
committerDavid S. Miller <davem@davemloft.net>2023-10-01 13:20:36 +0100
commit1add90738cf58def972356ecf402e36397187db7 (patch)
tree7b85129c63518a18cfa80a37d2a60850d9877856
parent66ac08a7385fa8a5d3312ca96d1399670cfca0eb (diff)
downloadlinux-stable-1add90738cf58def972356ecf402e36397187db7.tar.gz
linux-stable-1add90738cf58def972356ecf402e36397187db7.tar.bz2
linux-stable-1add90738cf58def972356ecf402e36397187db7.zip
net_sched: constify qdisc_priv()
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>
-rw-r--r--include/net/pkt_sched.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 15960564e0c3..9fa1d0794dfa 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -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)
{