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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210407015039.0183c91c@thinkpad>
Date:   Wed, 7 Apr 2021 01:50:39 +0200
From:   Marek Behún <kabel@...nel.org>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     netdev@...r.kernel.org, Russell King <rmk+kernel@...linux.org.uk>,
        "David S . Miller" <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>, kuba@...nel.org
Subject: Re: [PATCH net-next v3 09/18] include: bitmap: add macro for bitmap
 initialization

On Wed, 7 Apr 2021 01:38:30 +0200
Andrew Lunn <andrew@...n.ch> wrote:

> On Wed, Apr 07, 2021 at 12:10:58AM +0200, Marek Behún wrote:
> > Use the new variadic-macro.h library to implement macro
> > INITIALIZE_BITMAP(nbits, ...), which can be used for compile time bitmap
> > initialization in the form
> >   static DECLARE_BITMAP(bm, 100) = INITIALIZE_BITMAP(100, 7, 9, 66, 98);
> > 
> > The macro uses the BUILD_BUG_ON_ZERO mechanism to ensure a compile-time
> > error if an argument is out of range.
> > 
> > Signed-off-by: Marek Behún <kabel@...nel.org>
> > ---
> >  include/linux/bitmap.h | 24 ++++++++++++++++++++++++
> >  1 file changed, 24 insertions(+)
> > 
> > diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
> > index 70a932470b2d..a9e74d3420bf 100644
> > --- a/include/linux/bitmap.h
> > +++ b/include/linux/bitmap.h
> > @@ -8,6 +8,7 @@
> >  #include <linux/bitops.h>
> >  #include <linux/string.h>
> >  #include <linux/kernel.h>
> > +#include <linux/variadic-macro.h>
> >  
> >  /*
> >   * bitmaps provide bit arrays that consume one or more unsigned
> > @@ -114,6 +115,29 @@
> >   * contain all bit positions from 0 to 'bits' - 1.
> >   */
> >  
> > +/**
> > + * DOC: initialize bitmap
> > + * The INITIALIZE_BITMAP(bits, args...) macro expands to a designated
> > + * initializer for bitmap of length 'bits', setting each bit specified
> > + * in 'args...'.
> > + */  
> 
> Doesn't the /** mean this is kernel doc? The rest does not seem to
> follow kdoc. Does this compile cleanly with W=1?
> 
>        Andrew

Hmm. I just used the same style as was above in the same file, for
/**
 * DOC: declare bitmap
 ...

Anyway W=1 does not complain.

But it does complain about the implementation for INITIALIZE_BITMAP. It
seems that we have to use -Wno-override-init.
This seems to be a new option for gcc. For clang,
scripts/Makefile.extrawarn already uses -Wno-initializer-overrides, but
we have to add -Wno-override-init for gcc.

Marek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ