[PATCH] dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED

Subsystems: marvell 88e6xxx ethernet switch fabric driver, networking drivers, networking [dsa], the rest

STALE1759d

3 messages, 3 authors, 2021-12-16 · open the first message on its own page

[PATCH] dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED

From: Andrey Eremeev <hidden>
Date: 2021-12-15 17:36:34

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 <redacted>
Fixes: 96a2b40c7bd3 ("net: dsa: mv88e6xxx: add port's MAC speed setter")
---
 drivers/net/dsa/mv88e6xxx/port.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index d9817b20ea64..ab41619a809b 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -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);
--
2.30.1 (Apple Git-130)

Re: [PATCH] dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-12-15 17:47:03

On Wed, Dec 15, 2021 at 08:30:32PM +0300, Andrey Eremeev wrote:
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 <redacted>
Fixes: 96a2b40c7bd3 ("net: dsa: mv88e6xxx: add port's MAC speed setter")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

Re: [PATCH] dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-12-16 11:00:16

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

On Wed, 15 Dec 2021 20:30:32 +0300 you wrote:
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 <redacted>
Fixes: 96a2b40c7bd3 ("net: dsa: mv88e6xxx: add port's MAC speed setter")

[...]
Here is the summary with links:
  - dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED
    https://git.kernel.org/netdev/net/c/e08cdf63049b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help