Skip to contentSkip to conversation

net: dsa: mv88e6xxx: fix unused function warning

PATCH In review Arnd Bergmann 2 participants 3 messages Mar 4, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: mv88e6xxx: fix unused function warning

The newly introduced function is only used inside of an #ifdef and causes a warning when that is disabled:

drivers/net/dsa/mv88e6xxx/chip.c:4623:13: error: unused function 'mv88e6xxx_ports_cmode_init' [-Werror,-Wunused-function]

Move it into the same #ifdef block to shut up the warning.

Fixes ed8fe20205ac ("net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode")
---
 drivers/net/dsa/mv88e6xxx/chip.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +8 -8
index e4ad16b2dc38..168d4898c36f 100644
@@ -4620,14 +4620,6 @@ static int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip,
 	return 0;
 }
 
-static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip)
-{
-	int i;
-
-	for (i = 0; i < mv88e6xxx_num_ports(chip); i++)
-		chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID;
-}
-
 static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
 							int port)
 {
@@ -4637,6 +4629,14 @@ static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
 }
 
 #if IS_ENABLED(CONFIG_NET_DSA_LEGACY)
+static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip)
+{
+	int i;
+
+	for (i = 0; i < mv88e6xxx_num_ports(chip); i++)
+		chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID;
+}
+
 static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
 				       struct device *host_dev, int sw_addr,
 				       void **priv)
Signature · 1 line
2.20.0
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The newly introduced function is only used inside of an #ifdef and causes a warning when that is disabled:

drivers/net/dsa/mv88e6xxx/chip.c:4623:13: error: unused function 'mv88e6xxx_ports_cmode_init' [-Werror,-Wunused-function]

Move it into the same #ifdef block to shut up the warning.

Fixes ed8fe20205ac ("net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode")

---

A fix has been submitted already. See discussion here:
https://marc.info/?t=155170356600004&r=1&w=2
and the fix here:
https://patchwork.ozlabs.org/patch/1051275/

Heiner

#2 lore raw
Quoted 9 lines · Heiner Kallweit
Quoted 7 lines · Arnd Bergmann

The newly introduced function is only used inside of an #ifdef and causes a warning when that is disabled:

drivers/net/dsa/mv88e6xxx/chip.c:4623:13: error: unused function 'mv88e6xxx_ports_cmode_init' [-Werror,-Wunused-function]

Move it into the same #ifdef block to shut up the warning.

Quoted 7 lines
Quoted 3 lines
Fixes ed8fe20205ac ("net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode")

---

A fix has been submitted already. See discussion here:
https://marc.info/?t=155170356600004&r=1&w=2
and the fix here:
https://patchwork.ozlabs.org/patch/1051275/

Ok, that looks good, thanks for the reply!

Arnd