[openwrt/openwrt] generic: fix kernel warning no previous prototype for ...

LEDE Commits lede-commits at lists.infradead.org
Fri Apr 11 11:34:49 PDT 2025


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/473cfb4ff532210cfdd564b56f48aecf8b610e69

commit 473cfb4ff532210cfdd564b56f48aecf8b610e69
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri Apr 11 11:45:13 2025 +0200

    generic: fix kernel warning no previous prototype for ...
    
    It seems new kernel version introduced -Wmissing-prototypes. This new
    warning reported drivers that define non static function that are used
    statically in the driver.
    
    Fix this by declaring making those function actually static if not
    defined in any header and not used outside of the single driver.
    
    Co-authored-by: Mieczyslaw Nalewaj <namiltd at yahoo.com>
    Signed-off-by: Mieczyslaw Nalewaj <namiltd at yahoo.com>
    Link: https://github.com/openwrt/openwrt/pull/18455
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/generic/files/drivers/net/phy/ar8327.c      | 12 ++++++------
 target/linux/generic/files/drivers/net/phy/rtl8366_smi.c |  6 +++---
 target/linux/generic/files/drivers/net/phy/swconfig.c    |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c
index ff9ff5df3c..d6749ad70e 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8327.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8327.c
@@ -1210,7 +1210,7 @@ ar8327_sw_hw_apply(struct switch_dev *dev)
 	return 0;
 }
 
-int
+static int
 ar8327_sw_get_port_igmp_snooping(struct switch_dev *dev,
 				 const struct switch_attr *attr,
 				 struct switch_val *val)
@@ -1228,7 +1228,7 @@ ar8327_sw_get_port_igmp_snooping(struct switch_dev *dev,
 	return 0;
 }
 
-int
+static int
 ar8327_sw_set_port_igmp_snooping(struct switch_dev *dev,
 				 const struct switch_attr *attr,
 				 struct switch_val *val)
@@ -1246,7 +1246,7 @@ ar8327_sw_set_port_igmp_snooping(struct switch_dev *dev,
 	return 0;
 }
 
-int
+static int
 ar8327_sw_get_igmp_snooping(struct switch_dev *dev,
 			    const struct switch_attr *attr,
 			    struct switch_val *val)
@@ -1263,7 +1263,7 @@ ar8327_sw_get_igmp_snooping(struct switch_dev *dev,
 	return 0;
 }
 
-int
+static int
 ar8327_sw_set_igmp_snooping(struct switch_dev *dev,
 			    const struct switch_attr *attr,
 			    struct switch_val *val)
@@ -1279,7 +1279,7 @@ ar8327_sw_set_igmp_snooping(struct switch_dev *dev,
 	return 0;
 }
 
-int
+static int
 ar8327_sw_get_igmp_v3(struct switch_dev *dev,
 		      const struct switch_attr *attr,
 		      struct switch_val *val)
@@ -1295,7 +1295,7 @@ ar8327_sw_get_igmp_v3(struct switch_dev *dev,
 	return 0;
 }
 
-int
+static int
 ar8327_sw_set_igmp_v3(struct switch_dev *dev,
 		      const struct switch_attr *attr,
 		      struct switch_val *val)
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
index a26fd204cb..89fc04fa64 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
@@ -254,7 +254,7 @@ static int __rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
 #define MDC_MDIO_WRITE_OP		0x0003
 #define MDC_REALTEK_PHY_ADDR		0x0
 
-int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
+static int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
 {
 	u32 phy_id = smi->phy_id;
 	struct mii_bus *mbus = smi->ext_mbus;
@@ -1527,7 +1527,7 @@ static void rtl8366_smi_reset(struct rtl8366_smi *smi, bool active)
 		reset_control_deassert(smi->reset);
 }
 
-int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
+static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
 {
 	int sck = of_get_named_gpio(pdev->dev.of_node, "gpio-sck", 0);
 	int sda = of_get_named_gpio(pdev->dev.of_node, "gpio-sda", 0);
@@ -1577,7 +1577,7 @@ static inline int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8
 }
 #endif
 
-int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi)
+static int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi)
 {
 	struct rtl8366_platform_data *pdata = pdev->dev.platform_data;
 
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c
index 10dc8d0607..71dd5b31f5 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
@@ -1057,7 +1057,7 @@ static struct genl_family switch_fam = {
 };
 
 #ifdef CONFIG_OF
-void
+static void
 of_switch_load_portmap(struct switch_dev *dev)
 {
 	struct device_node *port;




More information about the lede-commits mailing list