Re: [PATCH net-next v2] net: ti: icssg-prueth: Split out common object into module
From: Roger Quadros
Date: Wed Jun 26 2024 - 03:37:38 EST
On 06/06/2024 10:36, MD Danish Anwar wrote:
> icssg_prueth.c and icssg_prueth_sr1.c drivers use multiple common .c
> files. These common objects are getting added to multiple modules. As a
> result when both drivers are enabled in .config, below warning is seen.
>
> drivers/net/ethernet/ti/Makefile: icssg/icssg_common.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
> drivers/net/ethernet/ti/Makefile: icssg/icssg_classifier.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
> drivers/net/ethernet/ti/Makefile: icssg/icssg_config.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
> drivers/net/ethernet/ti/Makefile: icssg/icssg_mii_cfg.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
> drivers/net/ethernet/ti/Makefile: icssg/icssg_stats.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
> drivers/net/ethernet/ti/Makefile: icssg/icssg_ethtool.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
>
> Fix this by building a new module (icssg.o) for all the common objects.
> Both the driver can then depend on this common module.
>
> This also fixes below error seen when both drivers are built.
> ERROR: modpost: "icssg_queue_pop"
> [drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
> ERROR: modpost: "icssg_queue_push"
> [drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202405182038.ncf1mL7Z-lkp@xxxxxxxxx/
> Fixes: 487f7323f39a ("net: ti: icssg-prueth: Add helper functions to configure FDB")
> Signed-off-by: MD Danish Anwar <danishanwar@xxxxxx>
Reviewed-by: Roger Quadros <rogerq@xxxxxxxxxx>