lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZEJXzN5FtXMUioFF@corigine.com>
Date:   Fri, 21 Apr 2023 11:30:52 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Pedro Tammela <pctammela@...atatu.com>, netdev@...r.kernel.org,
        jhs@...atatu.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
        davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com
Subject: Re: [PATCH net-next v3 5/5] net/sched: sch_qfq: BITify two bound
 definitions

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@...atatu.com> wrote:
> >
> > For the sake of readability, change these two definitions to BIT()
> > macros.
> >
> > Acked-by: Jamal Hadi Salim <jhs@...atatu.com>
> > Signed-off-by: Pedro Tammela <pctammela@...atatu.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ