[PATCH v2 net-next 11/15] net: ethernet: mtk_eth_soc: introduce device register map

Lorenzo Bianconi lorenzo at kernel.org
Wed May 18 02:48:43 PDT 2022


> On Mon, 16 May 2022 18:06:38 +0200 Lorenzo Bianconi wrote:
> >  /* PDMA RX Base Pointer Register */
> > -#define MTK_PRX_BASE_PTR0	0x900
> > +#define MTK_PRX_BASE_PTR0	(eth->soc->reg_map[MTK_PDMA_BASE] + 0x100)
> >  #define MTK_PRX_BASE_PTR_CFG(x)	(MTK_PRX_BASE_PTR0 + (x * 0x10))
> 
> Implicit macro arguments are really unpleasant for people doing
> tree-wide changes or otherwise unfamiliar with the driver.
> 
> Nothing we can do to avoid this?

I used this approach in order to have just few changes in the codebase. I guess the best
option would be to explicitly add eth parameter to the register macros, what do you think?

Regards,
Lorenzo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20220518/f8ae79f7/attachment.sig>


More information about the Linux-mediatek mailing list