Skip to contentSkip to conversation

net: ethernet: renesas: Fix return type in rswitch_etha_wait_link_verification()

PATCH Applied Dan Carpenter 4 participants 4 messages Nov 15, 2022 – Nov 17, 2022

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

PATCH 1/1 net: ethernet: renesas: Fix return type in rswitch_etha_wait_link_verification()

The rswitch_etha_wait_link_verification() is supposed to return zero on success or negative error codes. Unfortunately it is declared as a bool so the caller treats everything as success.

Fixes 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
---
 drivers/net/ethernet/renesas/rswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/renesas/rswitch.c +1 -1
index f0168fedfef9..231e8c688b89 100644
@@ -920,7 +920,7 @@ static void rswitch_etha_write_mac_address(struct rswitch_etha *etha, const u8 *
 		  etha->addr + MRMAC1);
 }
 
-static bool rswitch_etha_wait_link_verification(struct rswitch_etha *etha)
+static int rswitch_etha_wait_link_verification(struct rswitch_etha *etha)
 {
 	iowrite32(MLVC_PLV, etha->addr + MLVC);
 
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

The rswitch_etha_wait_link_verification() is supposed to return zero on success or negative error codes. Unfortunately it is declared as a bool so the caller treats everything as success.

Fixes 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter

Hi Dan,

Quoted 8 lines

From: Dan Carpenter, Sent: Tuesday, November 15, 2022 10:10 PM

The rswitch_etha_wait_link_verification() is supposed to return zero on success or negative error codes. Unfortunately it is declared as a bool so the caller treats everything as success.

Fixes 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")

Thank you for the patch!

Best regards,
Yoshihiro Shimoda

Quoted 19 lines
---
 drivers/net/ethernet/renesas/rswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/renesas/rswitch.c +1 -2
index f0168fedfef9..231e8c688b89 100644
@@ -920,7 +920,7 @@ static void rswitch_etha_write_mac_address(struct rswitch_etha *etha, const u8 *
 		  etha->addr + MRMAC1);
 }
 
-static bool rswitch_etha_wait_link_verification(struct rswitch_etha *etha)
+static int rswitch_etha_wait_link_verification(struct rswitch_etha *etha)
 {
 	iowrite32(MLVC_PLV, etha->addr + MLVC);
 
--

2.35.1

#3 lore raw
In reply to Dan Carpenter
This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Tue, 15 Nov 2022 16:09:55 +0300 you wrote:

The rswitch_etha_wait_link_verification() is supposed to return zero on success or negative error codes. Unfortunately it is declared as a bool so the caller treats everything as success.

Fixes 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")

[...]

Here is the summary with links:
- [net-next] net: ethernet: renesas: Fix return type in rswitch_etha_wait_link_verification()

    https://git.kernel.org/netdev/net-next/c/b4b221bd79a1

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html