All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, Russell King <rmk+kernel@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	kuba@kernel.org
Subject: Re: [PATCH net-next v3 09/18] include: bitmap: add macro for bitmap initialization
Date: Wed, 7 Apr 2021 01:50:39 +0200	[thread overview]
Message-ID: <20210407015039.0183c91c@thinkpad> (raw)
In-Reply-To: <YGzw9keA5yZc09bZ@lunn.ch>

On Wed, 7 Apr 2021 01:38:30 +0200
Andrew Lunn <andrew@lunn.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@kernel.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

  reply	other threads:[~2021-04-06 23:50 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 22:10 [PATCH net-next v3 00/18] net: phy: marvell10g updates Marek Behún
2021-04-06 22:10 ` [PATCH net-next v3 01/18] net: phy: marvell10g: rename register Marek Behún
2021-04-06 22:37   ` Andrew Lunn
2021-04-06 22:10 ` [PATCH net-next v3 02/18] net: phy: marvell10g: fix typo Marek Behún
2021-04-06 22:38   ` Andrew Lunn
2021-04-06 22:10 ` [PATCH net-next v3 03/18] net: phy: marvell10g: allow 5gbase-r and usxgmii Marek Behún
2021-04-06 22:39   ` Andrew Lunn
2021-04-06 22:10 ` [PATCH net-next v3 04/18] net: phy: marvell10g: indicate 88X33x0 only port control registers Marek Behún
2021-04-07  0:10   ` Andrew Lunn
2021-04-07  0:22     ` Marek Behún
2021-04-06 22:10 ` [PATCH net-next v3 05/18] net: phy: marvell10g: add all MACTYPE definitions for 88X33x0 Marek Behún
2021-04-06 23:22   ` Andrew Lunn
2021-04-06 22:10 ` [PATCH net-next v3 06/18] net: phy: marvell10g: add MACTYPE definitions for 88E21xx Marek Behún
2021-04-06 23:22   ` Andrew Lunn
2021-04-06 22:10 ` [PATCH net-next v3 07/18] net: phy: marvell10g: support all rate matching modes Marek Behún
2021-04-06 23:30   ` Andrew Lunn
2021-04-06 23:36     ` Marek Behún
2021-04-06 23:33   ` Andrew Lunn
2021-04-06 23:53     ` Marek Behún
2021-04-06 22:10 ` [PATCH net-next v3 08/18] include: add library helpers for variadic macro expansion Marek Behún
2021-04-06 22:10 ` [PATCH net-next v3 09/18] include: bitmap: add macro for bitmap initialization Marek Behún
2021-04-06 23:38   ` Andrew Lunn
2021-04-06 23:50     ` Marek Behún [this message]
2021-04-06 22:10 ` [PATCH net-next v3 10/18] net: phy: marvell10g: check for correct supported interface mode Marek Behún
2021-04-06 23:40   ` Andrew Lunn
2021-04-07  9:04   ` kernel test robot
2021-04-06 22:11 ` [PATCH net-next v3 11/18] net: phy: marvell10g: store temperature read method in chip strucutre Marek Behún
2021-04-06 23:42   ` Andrew Lunn
2021-04-06 22:11 ` [PATCH net-next v3 12/18] net: phy: marvell10g: support other MACTYPEs Marek Behún
2021-04-06 22:11 ` [PATCH net-next v3 13/18] net: phy: marvell10g: add separate structure for 88X3340 Marek Behún
2021-04-06 23:47   ` Andrew Lunn
2021-04-06 22:11 ` [PATCH net-next v3 14/18] net: phy: marvell10g: fix driver name for mv88e2110 Marek Behún
2021-04-06 23:49   ` Andrew Lunn
2021-04-06 22:11 ` [PATCH net-next v3 15/18] net: phy: add constants for 2.5G and 5G speed in PCS speed register Marek Behún
2021-04-06 23:59   ` Andrew Lunn
2021-04-06 22:11 ` [PATCH net-next v3 16/18] net: phy: marvell10g: differentiate 88E2110 vs 88E2111 Marek Behún
2021-04-07  0:01   ` Andrew Lunn
2021-04-06 22:11 ` [PATCH net-next v3 17/18] net: phy: marvell10g: change module description Marek Behún
2021-04-07  0:01   ` Andrew Lunn
2021-04-06 22:11 ` [PATCH net-next v3 18/18] MAINTAINERS: add myself as maintainer of marvell10g driver Marek Behún

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=20210407015039.0183c91c@thinkpad \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /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.