Commit e08cdf63 authored by Andrey Eremeev's avatar Andrey Eremeev Committed by David S. Miller

dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED

Debug print uses invalid check to detect if speed is unforced:
(speed != SPEED_UNFORCED) should be used instead of (!speed).

Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: default avatarAndrey Eremeev <Axtone4all@yandex.ru>
Fixes: 96a2b40c ("net: dsa: mv88e6xxx: add port's MAC speed setter")
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 407ecd1b
...@@ -283,7 +283,7 @@ static int mv88e6xxx_port_set_speed_duplex(struct mv88e6xxx_chip *chip, ...@@ -283,7 +283,7 @@ static int mv88e6xxx_port_set_speed_duplex(struct mv88e6xxx_chip *chip,
if (err) if (err)
return err; return err;
if (speed) if (speed != SPEED_UNFORCED)
dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed); dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);
else else
dev_dbg(chip->dev, "p%d: Speed unforced\n", port); dev_dbg(chip->dev, "p%d: Speed unforced\n", port);
...@@ -516,7 +516,7 @@ int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port, ...@@ -516,7 +516,7 @@ int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
if (err) if (err)
return err; return err;
if (speed) if (speed != SPEED_UNFORCED)
dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed); dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);
else else
dev_dbg(chip->dev, "p%d: Speed unforced\n", port); dev_dbg(chip->dev, "p%d: Speed unforced\n", port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment