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: <CANn89iJsn1Xj8Y4tL69FA5a0y21R4-qBjMddH5rGOBD_iQ0qmw@mail.gmail.com>
Date:   Fri, 21 Apr 2023 11:17:23 +0200
From:   Eric Dumazet <edumazet@...gle.com>
To:     Pedro Tammela <pctammela@...atatu.com>
Cc:     netdev@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
        jiri@...nulli.us, davem@...emloft.net, kuba@...nel.org,
        pabeni@...hat.com, simon.horman@...igine.com
Subject: Re: [PATCH net-next v3 5/5] net/sched: sch_qfq: BITify two bound definitions

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))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ