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

On Wed, Mar 06, 2024 at 04:43:11PM +0100, Herve Codina wrote:
> 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.

I also think that this can be done later, above is just a pure suggestion how.

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

Right.

-- 
With Best Regards,
Andy Shevchenko



WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Herve Codina <herve.codina@bootlin.com>
Cc: Yury Norov <yury.norov@gmail.com>,
	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 17:55:46 +0200	[thread overview]
Message-ID: <ZeiSArlb24aSp-CJ@smile.fi.intel.com> (raw)
In-Reply-To: <20240306164311.735ded83@bootlin.com>

On Wed, Mar 06, 2024 at 04:43:11PM +0100, Herve Codina wrote:
> 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.

I also think that this can be done later, above is just a pure suggestion how.

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

Right.

-- 
With Best Regards,
Andy Shevchenko



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

Thread overview: 41+ 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 ` Herve Codina
2024-03-06  8:07 ` [PATCH v6 1/5] net: wan: " Herve Codina
2024-03-06  8:07   ` 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:27     ` Yury Norov
2024-03-06 13:38     ` Andy Shevchenko
2024-03-06 13:38       ` Andy Shevchenko
2024-03-06 16:22       ` Jakub Kicinski
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   ` 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  8:07   ` Herve Codina
2024-03-06 13:11   ` Yury Norov
2024-03-06 13:11     ` Yury Norov
2024-03-06 13:39     ` Andy Shevchenko
2024-03-06 13:39       ` Andy Shevchenko
2024-03-07  7:31       ` Herve Codina
2024-03-07  7:31         ` Herve Codina
2024-03-07 11:14         ` Yury Norov
2024-03-06  8:07 ` [PATCH v6 4/5] net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support Herve Codina
2024-03-06  8:07   ` Herve Codina
2024-03-06 13:06   ` Yury Norov
2024-03-06 13:06     ` Yury Norov
2024-03-06 13:43     ` Andy Shevchenko
2024-03-06 13:43       ` Andy Shevchenko
2024-03-06 15:43       ` Herve Codina
2024-03-06 15:43         ` Herve Codina
2024-03-06 15:55         ` Andy Shevchenko [this message]
2024-03-06 15:55           ` Andy Shevchenko
2024-03-07  7:26     ` Herve Codina
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
2024-03-06  8:07   ` 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=ZeiSArlb24aSp-CJ@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andrew@lunn.ch \
    --cc=broonie@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herve.codina@bootlin.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 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.