generic: fix compilation warning for ar8xxx swconfig
authorAnsuel Smith <ansuelsmth@gmail.com>
Tue, 1 Mar 2022 15:47:11 +0000 (16:47 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 27 Mar 2022 03:51:38 +0000 (04:51 +0100)
There are 2 warning for ar8xxx swconfig.
- Fix not used dev variable when ETHERNET_PACKET_MANGLE
  is not selected
- Convert fallthrough comment to compilation macro

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
target/linux/generic/files/drivers/net/phy/ar8216.c
target/linux/generic/files/drivers/net/phy/ar8327.c

index 3e6494aebb3d7a8a867d5133ff2cb87131eea92c..bf98fd599ecb761d4b4f54c244302a9b1d35a7e6 100644 (file)
@@ -2433,7 +2433,9 @@ static int
 ar8xxx_phy_config_init(struct phy_device *phydev)
 {
        struct ar8xxx_priv *priv = phydev->priv;
+#ifdef CONFIG_ETHERNET_PACKET_MANGLE
        struct net_device *dev = phydev->attached_dev;
+#endif
        int ret;
 
        if (WARN_ON(!priv))
index dce52ce0e48c7ea2ed8e6eec4eb352d927756d12..33131495598084e122582493e977c4585dea7c1c 100644 (file)
@@ -183,7 +183,7 @@ ar8327_phy_fixup(struct ar8xxx_priv *priv, int phy)
 
        case 2:
                ar8xxx_phy_mmd_write(priv, phy, 0x7, 0x3c, 0x0);
-               /* fallthrough */
+               fallthrough;
        case 4:
                ar8xxx_phy_mmd_write(priv, phy, 0x3, 0x800d, 0x803f);
                ar8xxx_phy_dbg_write(priv, phy, 0x3d, 0x6860);