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: <CAHp75VcSc=myrcvyBOkaUDguR6aPjJAFFXi2iSvmU21+1664Hw@mail.gmail.com>
Date:   Fri, 29 Jan 2021 23:10:46 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Yury Norov <yury.norov@...il.com>
Cc:     linux-m68k <linux-m68k@...ts.linux-m68k.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux-SH <linux-sh@...r.kernel.org>,
        Linux-Arch <linux-arch@...r.kernel.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>, Arnd Bergmann <arnd@...db.de>,
        Dennis Zhou <dennis@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        David Sterba <dsterba@...e.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Stefano Brivio <sbrivio@...hat.com>,
        "Ma, Jianpeng" <jianpeng.ma@...el.com>,
        Wei Yang <richard.weiyang@...ux.alibaba.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>
Subject: Re: [PATCH 2/5] bits_per_long.h: introduce SMALL_CONST() macro

On Fri, Jan 29, 2021 at 10:49 PM Yury Norov <yury.norov@...il.com> wrote:
>
> Many algorithms become simplier if they are passed with relatively small

simpler

> input values. One example is bitmap operations when the whole bitmap fits
> into one word. To implement such simplifications, linux/bitmap.h declares
> small_const_nbits() macro.
>
> Other subsystems may also benefit from optimizations of this sort, like
> find_bit API in the following patches. So it looks helpful to generalize
> the macro and extend it's visibility.

> It should probably go to linux/kernel.h, but doing that creates circular
> dependencies. So put it in asm-generic/bitsperlong.h.

No, no, please leave kernel.h alone. It's already quite a mess.

And this shouldn't be in the commit message either.

...

> -       if (small_const_nbits(nbits))
> +       if (SMALL_CONST(nbits - 1))

Not sure if we need to rename it.

...

> --- a/include/linux/bits.h
> +++ b/include/linux/bits.h
> @@ -37,7 +37,7 @@
>  #define GENMASK(h, l) \
>         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
>
> -#define BITS_FIRST(nr)         GENMASK(nr), 0)
> +#define BITS_FIRST(nr)         GENMASK((nr), 0)

How come?!

...

> diff --git a/tools/include/asm-generic/bitsperlong.h b/tools/include/asm-generic/bitsperlong.h
> index 8f2283052333..432d272baf27 100644
> --- a/tools/include/asm-generic/bitsperlong.h
> +++ b/tools/include/asm-generic/bitsperlong.h

I think a tools update would be better to have in a separate patch.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ