]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
generic: fix kernel warning no previous prototype for ... 18455/head
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 11 Apr 2025 09:45:13 +0000 (11:45 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 11 Apr 2025 18:34:24 +0000 (20:34 +0200)
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@yahoo.com>
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18455
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/generic/files/drivers/net/phy/ar8327.c
target/linux/generic/files/drivers/net/phy/rtl8366_smi.c
target/linux/generic/files/drivers/net/phy/swconfig.c

index ff9ff5df3c3e8be497bdc07f9d12ace2e3d8e041..d6749ad70ed2a93864e78db87a67b5f01a861b81 100644 (file)
@@ -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)
index a26fd204cb25dbf25a4bc4c3deab21b1c1d29aed..89fc04fa64d75dec4c7cce42462d7a979ec72ec5 100644 (file)
@@ -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;
 
index 10dc8d0607aa93bd484f05039393f46a30f5f4bc..71dd5b31f541eb2d2fbb8757fdf4bbf1fbba23c7 100644 (file)
@@ -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;