From 473cfb4ff532210cfdd564b56f48aecf8b610e69 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 11 Apr 2025 11:45:13 +0200 Subject: [PATCH] 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 Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/18455 Signed-off-by: Christian Marangi --- target/linux/generic/files/drivers/net/phy/ar8327.c | 12 ++++++------ .../generic/files/drivers/net/phy/rtl8366_smi.c | 6 +++--- .../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 ff9ff5df3c3..d6749ad70ed 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 a26fd204cb2..89fc04fa64d 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 10dc8d0607a..71dd5b31f54 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;