Thread (18 messages) 18 messages, 4 authors, 2024-03-07

Re: [PATCH v6 4/5] net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support

From: Herve Codina <herve.codina@bootlin.com>
Date: 2024-03-06 15:43:17
Also in: lkml, netdev

Hi Andy, Yury,

On Wed, 6 Mar 2024 15:43:04 +0200
Andy Shevchenko [off-list ref] wrote:
On Wed, Mar 06, 2024 at 05:06:12AM -0800, Yury Norov wrote:
quoted
On Wed, Mar 06, 2024 at 09:07:20AM +0100, Herve Codina wrote:  
...
quoted
quoted
+	DECLARE_BITMAP(ts_mask_avail, 64);
+	DECLARE_BITMAP(ts_mask, 64);
+	DECLARE_BITMAP(map, 64);  
quoted
quoted
+	bitmap_from_u64(ts_mask_avail, ts_info->rx_ts_mask_avail);
+	bitmap_from_u64(map, slot_map);  
quoted
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é
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help