Skip to content

Commit 1d7b2ce

Browse files
Wei Fangkuba-moo
authored andcommitted
net: enetc: add missing static descriptor and inline keyword
Fix the build warnings when CONFIG_FSL_ENETC_MDIO is not enabled. The detailed warnings are shown as follows. include/linux/fsl/enetc_mdio.h:62:18: warning: no previous prototype for function 'enetc_hw_alloc' [-Wmissing-prototypes] 62 | struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs) | ^ include/linux/fsl/enetc_mdio.h:62:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 62 | struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs) | ^ | static 8 warnings generated. Fixes: 6517798 ("enetc: Make MDIO accessors more generic and export to include/linux/fsl") Cc: stable@vger.kernel.org Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202410102136.jQHZOcS4-lkp@intel.com/ Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20241011030103.392362-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0af8c8a commit 1d7b2ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/linux/fsl/enetc_mdio.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ static inline int enetc_mdio_read_c45(struct mii_bus *bus, int phy_id,
5959
static inline int enetc_mdio_write_c45(struct mii_bus *bus, int phy_id,
6060
int devad, int regnum, u16 value)
6161
{ return -EINVAL; }
62-
struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs)
62+
static inline struct enetc_hw *enetc_hw_alloc(struct device *dev,
63+
void __iomem *port_regs)
6364
{ return ERR_PTR(-EINVAL); }
6465

6566
#endif

0 commit comments

Comments
 (0)