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: <ZeiSArlb24aSp-CJ@smile.fi.intel.com>
Date: Wed, 6 Mar 2024 17:55:46 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Herve Codina <herve.codina@...tlin.com>
Cc: Yury Norov <yury.norov@...il.com>,
	Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Rasmus Villemoes <linux@...musvillemoes.dk>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	linuxppc-dev@...ts.ozlabs.org, Andrew Lunn <andrew@...n.ch>,
	Mark Brown <broonie@...nel.org>,
	Christophe Leroy <christophe.leroy@...roup.eu>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v6 4/5] net: wan: fsl_qmc_hdlc: Add runtime timeslots
 changes support

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



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ