Skip to content

Commit e08cdf6

Browse files
Andrey Eremeevdavem330
authored andcommitted
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: Andrey Eremeev <[email protected]> Fixes: 96a2b40 ("net: dsa: mv88e6xxx: add port's MAC speed setter") Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 407ecd1 commit e08cdf6

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/dsa/mv88e6xxx

1 file changed

+2
-2
lines changed

drivers/net/dsa/mv88e6xxx/port.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static int mv88e6xxx_port_set_speed_duplex(struct mv88e6xxx_chip *chip,
283283
if (err)
284284
return err;
285285

286-
if (speed)
286+
if (speed != SPEED_UNFORCED)
287287
dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);
288288
else
289289
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,
516516
if (err)
517517
return err;
518518

519-
if (speed)
519+
if (speed != SPEED_UNFORCED)
520520
dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);
521521
else
522522
dev_dbg(chip->dev, "p%d: Speed unforced\n", port);

0 commit comments

Comments
 (0)