From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Willem de Bruijn <willemb@google.com>,
Soheil Hassas Yeganeh <soheil@google.com>,
Neal Cardwell <ncardwell@google.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
netdev@vger.kernel.org, eric.dumazet@gmail.com,
Eric Dumazet <edumazet@google.com>
Subject: [PATCH v2 net-next 1/5] net_sched: constify qdisc_priv()
Date: Wed, 20 Sep 2023 20:17:11 +0000 [thread overview]
Message-ID: <20230920201715.418491-2-edumazet@google.com> (raw)
In-Reply-To: <20230920201715.418491-1-edumazet@google.com>
In order to propagate const qualifiers, we change qdisc_priv()
to accept a possibly const argument.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/pkt_sched.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 15960564e0c364ef430f1e3fcdd0e835c2f94a77..9fa1d0794dfa5241705f9a39c896ed44519a9f13 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)
{
--
2.42.0.459.ge4e396fd5e-goog
next prev parent reply other threads:[~2023-09-20 20:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 20:17 [PATCH v2 net-next 0/5] net_sched: sch_fq: round of improvements Eric Dumazet
2023-09-20 20:17 ` Eric Dumazet [this message]
2023-09-20 20:45 ` [PATCH v2 net-next 1/5] net_sched: constify qdisc_priv() Jamal Hadi Salim
2023-09-20 21:32 ` Eric Dumazet
2023-09-20 22:56 ` Jamal Hadi Salim
2023-09-20 20:17 ` [PATCH v2 net-next 2/5] net_sched: sch_fq: struct sched_data reorg Eric Dumazet
2023-09-20 20:17 ` [PATCH v2 net-next 3/5] net_sched: sch_fq: change how @inactive is tracked Eric Dumazet
2023-09-20 20:17 ` [PATCH v2 net-next 4/5] net_sched: sch_fq: add fast path for mostly idle qdisc Eric Dumazet
2023-09-20 20:17 ` [PATCH v2 net-next 5/5] net_sched: sch_fq: always garbage collect Eric Dumazet
2023-09-20 23:22 ` [PATCH v2 net-next 0/5] net_sched: sch_fq: round of improvements Jamal Hadi Salim
2023-09-21 0:16 ` Willem de Bruijn
2023-09-21 9:33 ` Toke Høiland-Jørgensen
2023-10-01 12:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230920201715.418491-2-edumazet@google.com \
--to=edumazet@google.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=soheil@google.com \
--cc=willemb@google.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.