]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED
authorAndrey Eremeev <Axtone4all@yandex.ru>
Wed, 15 Dec 2021 17:30:32 +0000 (20:30 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Dec 2021 10:57:21 +0000 (10:57 +0000)
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 <Axtone4all@yandex.ru>
Fixes: f4b4622108c0 ("net: dsa: mv88e6xxx: add port's MAC speed setter")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/port.c

index d9817b20ea641f9b642435e693b5ee7e86398a7e..ab41619a809b3e98c3da9a53ec455c42a79a7293 100644 (file)
@@ -283,7 +283,7 @@ static int mv88e6xxx_port_set_speed_duplex(struct mv88e6xxx_chip *chip,
        if (err)
                return err;
 
-       if (speed)
+       if (speed != SPEED_UNFORCED)
                dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);
        else
                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,
        if (err)
                return err;
 
-       if (speed)
+       if (speed != SPEED_UNFORCED)
                dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);
        else
                dev_dbg(chip->dev, "p%d: Speed unforced\n", port);