mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] net: ethernet: renesas: rswitch: Fix signedness bug in rswitch_etha_wait_link_verification()
@ 2022-11-18  6:32 YueHaibing
  2022-11-18 10:01 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2022-11-18  6:32 UTC (permalink / raw)
  To: s.shtylyov, davem, edumazet, kuba, pabeni, yoshihiro.shimoda.uh, andrew
  Cc: netdev, linux-renesas-soc, linux-kernel, YueHaibing

rswitch_reg_wait() may return negative value, which converts to true later.
However rswitch_etha_hw_init() only check it less than zero.

Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/renesas/rswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
index f3d27aef1286..c098b27093ea 100644
--- a/drivers/net/ethernet/renesas/rswitch.c
+++ b/drivers/net/ethernet/renesas/rswitch.c
@@ -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.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: ethernet: renesas: rswitch: Fix signedness bug in rswitch_etha_wait_link_verification()
  2022-11-18  6:32 [PATCH net-next] net: ethernet: renesas: rswitch: Fix signedness bug in rswitch_etha_wait_link_verification() YueHaibing
@ 2022-11-18 10:01 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2022-11-18 10:01 UTC (permalink / raw)
  To: YueHaibing
  Cc: s.shtylyov, davem, edumazet, kuba, pabeni, yoshihiro.shimoda.uh,
	andrew, netdev, linux-renesas-soc, linux-kernel

Hi Yue,

On Fri, Nov 18, 2022 at 7:36 AM YueHaibing <yuehaibing@huawei.com> wrote:
> rswitch_reg_wait() may return negative value, which converts to true later.
> However rswitch_etha_hw_init() only check it less than zero.
>
> Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Thanks for your patch!

A similar patch was already applied as
https://git.kernel.org/netdev/net-next/c/b4b221bd79a1

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-18 10:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18  6:32 [PATCH net-next] net: ethernet: renesas: rswitch: Fix signedness bug in rswitch_etha_wait_link_verification() YueHaibing
2022-11-18 10:01 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®