netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Yury Norov <yury.norov@gmail.com>
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, Andrew Lunn <andrew@lunn.ch>,
	Mark Brown <broonie@kernel.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v6 4/5] net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support
Date: Wed, 6 Mar 2024 16:43:11 +0100	[thread overview]
Message-ID: <20240306164311.735ded83@bootlin.com> (raw)
In-Reply-To: <Zehy6K0Sj-cqcxZE@smile.fi.intel.com>

Hi Andy, Yury,

On Wed, 6 Mar 2024 15:43:04 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Wed, Mar 06, 2024 at 05:06:12AM -0800, Yury Norov wrote:
> > On Wed, Mar 06, 2024 at 09:07:20AM +0100, Herve Codina wrote:  
> 
> ...
> 
> > > +	DECLARE_BITMAP(ts_mask_avail, 64);
> > > +	DECLARE_BITMAP(ts_mask, 64);
> > > +	DECLARE_BITMAP(map, 64);  
> 
> 
> > > +	bitmap_from_u64(ts_mask_avail, ts_info->rx_ts_mask_avail);
> > > +	bitmap_from_u64(map, slot_map);  
> 
> > We've got a BITMAP_FROM_U64() for this:
> > 
> > 	DECLARE_BITMAP(ts_mask_avail, 64) = { BITMAP_FROM_U64(ts_info->rx_ts_mask_avail) };
> > 	DECLARE_BITMAP(map, 64) = { BITMAP_FROM_U64(slot_map) };  
> 
> This looks ugly. Can we rather provide a macro that does this under the hood?
> 
> Roughly:
> 
> #define DEFINE_BITMAP_64(name, src)				\
> 	DECLARE_BITMAP(name, 64) = { BITMAP_FROM_U64(src) }
> 

Well, the construction I used:
	DECLARE_BITMAP(foo, 64);
	...
	bitmap_from_u64(foo, init_value);
	...
can be found in several places in the kernel.

Having the DEFINE_BITMAP_64() macro can be a way to remove this
construction but I am not sure that this should be done in this
series.

IMHO, a specific series introducing the macro and updating pieces of
code in the kernel everywhere it is needed to replace this construction
would make much more sense.


Best regards,
Hervé

  reply	other threads:[~2024-03-06 15:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  8:07 [PATCH v6 0/5] Add support for QMC HDLC Herve Codina
2024-03-06  8:07 ` [PATCH v6 1/5] net: wan: " Herve Codina
2024-03-06 10:56   ` Ratheesh Kannoth
2024-03-06 13:37     ` Herve Codina
2024-03-06 16:01       ` [EXTERNAL] " Ratheesh Kannoth
2024-03-06 16:22         ` Jakub Kicinski
2024-03-06 17:46           ` Herve Codina
2024-03-06 17:52             ` Jakub Kicinski
2024-03-06 13:27   ` Yury Norov
2024-03-06 13:38     ` Andy Shevchenko
2024-03-06 16:22       ` Jakub Kicinski
2024-03-06  8:07 ` [PATCH v6 2/5] MAINTAINERS: Add the Freescale QMC HDLC driver entry Herve Codina
2024-03-06  8:07 ` [PATCH v6 3/5] lib/bitmap: Introduce bitmap_scatter() and bitmap_gather() helpers Herve Codina
2024-03-06 13:11   ` Yury Norov
2024-03-06 13:39     ` Andy Shevchenko
2024-03-07  7:31       ` Herve Codina
2024-03-06  8:07 ` [PATCH v6 4/5] net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support Herve Codina
2024-03-06 13:06   ` Yury Norov
2024-03-06 13:43     ` Andy Shevchenko
2024-03-06 15:43       ` Herve Codina [this message]
2024-03-06 15:55         ` Andy Shevchenko
2024-03-07  7:26     ` Herve Codina
2024-03-06  8:07 ` [PATCH v6 5/5] net: wan: fsl_qmc_hdlc: Add framer support Herve Codina

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=20240306164311.735ded83@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=yury.norov@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).