From: Simon Horman <simon.horman@corigine.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Pedro Tammela <pctammela@mojatatu.com>,
netdev@vger.kernel.org, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net,
kuba@kernel.org, pabeni@redhat.com
Subject: Re: [PATCH net-next v3 5/5] net/sched: sch_qfq: BITify two bound definitions
Date: Fri, 21 Apr 2023 11:30:52 +0200 [thread overview]
Message-ID: <ZEJXzN5FtXMUioFF@corigine.com> (raw)
In-Reply-To: <CANn89iJsn1Xj8Y4tL69FA5a0y21R4-qBjMddH5rGOBD_iQ0qmw@mail.gmail.com>
On Fri, Apr 21, 2023 at 11:17:23AM +0200, Eric Dumazet wrote:
> On Thu, Apr 20, 2023 at 6:50 PM Pedro Tammela <pctammela@mojatatu.com> wrote:
> >
> > For the sake of readability, change these two definitions to BIT()
> > macros.
> >
> > Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
> > Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
> > ---
> > net/sched/sch_qfq.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
> > index dfd9a99e6257..4b9cc8a46e2a 100644
> > --- a/net/sched/sch_qfq.c
> > +++ b/net/sched/sch_qfq.c
> > @@ -105,7 +105,7 @@
> > #define QFQ_MAX_INDEX 24
> > #define QFQ_MAX_WSHIFT 10
> >
> > -#define QFQ_MAX_WEIGHT (1<<QFQ_MAX_WSHIFT) /* see qfq_slot_insert */
> > +#define QFQ_MAX_WEIGHT BIT(QFQ_MAX_WSHIFT) /* see qfq_slot_insert */
>
> I am not sure I find BIT(X) more readable in this context.
>
> Say MAX_WEIGHT was 0xF000, should we then use
>
> #define MAX_WEIGHT (BIT(15) | BIT(14) |BIT(13) | BIT(12))
Thanks Eric,
I think this is my mistake for suggesting this change.
I agree BIT() is not so good here after all.
next prev parent reply other threads:[~2023-04-21 9:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 16:49 [PATCH net-next v3 0/5] net/sched: cleanup parsing prints in htb and qfq Pedro Tammela
2023-04-20 16:49 ` [PATCH net-next v3 1/5] net/sched: sch_htb: use extack on errors messages Pedro Tammela
2023-04-20 16:49 ` [PATCH net-next v3 2/5] net/sched: sch_qfq: " Pedro Tammela
2023-04-20 16:49 ` [PATCH net-next v3 3/5] net/sched: sch_qfq: refactor parsing of netlink parameters Pedro Tammela
2023-04-20 16:49 ` [PATCH net-next v3 4/5] selftests: tc-testing: add more tests for sch_qfq Pedro Tammela
2023-04-20 16:49 ` [PATCH net-next v3 5/5] net/sched: sch_qfq: BITify two bound definitions Pedro Tammela
2023-04-21 9:10 ` Simon Horman
2023-04-21 9:17 ` Eric Dumazet
2023-04-21 9:30 ` Simon Horman [this message]
2023-04-21 14:31 ` Pedro Tammela
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=ZEJXzN5FtXMUioFF@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pctammela@mojatatu.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.