Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dwc-xlgmac: fix missing MODULE_DESCRIPTION() warning

With ARCH=hexagon, make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/net/ethernet/synopsys/dwc-xlgmac.o

With most other ARCH settings the MODULE_DESCRIPTION() is provided by
the macro invocation in dwc-xlgmac-pci.c. However, for hexagon, the
PCI bus is not enabled, and hence CONFIG_DWC_XLGMAC_PCI is not set.
As a result, dwc-xlgmac-pci.c is not compiled, and hence is not linked
into dwc-xlgmac.o.

To avoid this issue, relocate the MODULE_DESCRIPTION() and other
related macros from dwc-xlgmac-pci.c to dwc-xlgmac-common.c, since
that file already has an existing MODULE_LICENSE() and it is
unconditionally linked into dwc-xlgmac.o.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://lore.kernel.org/r/20240616-md-hexagon-drivers-net-ethernet-synopsys-v1-1-55852b60aef8@quicinc.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jeff Johnson and committed by
Jakub Kicinski
0d9bb144 e275e19c

+5 -7
+5 -2
drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
··· 21 21 #include "dwc-xlgmac.h" 22 22 #include "dwc-xlgmac-reg.h" 23 23 24 - MODULE_LICENSE("Dual BSD/GPL"); 25 - 26 24 static int debug = -1; 27 25 module_param(debug, int, 0644); 28 26 MODULE_PARM_DESC(debug, "DWC ethernet debug level (0=none,...,16=all)"); ··· 723 725 XLGMAC_PR("=====================================================\n"); 724 726 XLGMAC_PR("\n"); 725 727 } 728 + 729 + MODULE_DESCRIPTION(XLGMAC_DRV_DESC); 730 + MODULE_VERSION(XLGMAC_DRV_VERSION); 731 + MODULE_AUTHOR("Jie Deng <jiedeng@synopsys.com>"); 732 + MODULE_LICENSE("Dual BSD/GPL");
-5
drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
··· 71 71 }; 72 72 73 73 module_pci_driver(xlgmac_pci_driver); 74 - 75 - MODULE_DESCRIPTION(XLGMAC_DRV_DESC); 76 - MODULE_VERSION(XLGMAC_DRV_VERSION); 77 - MODULE_AUTHOR("Jie Deng <jiedeng@synopsys.com>"); 78 - MODULE_LICENSE("Dual BSD/GPL");