mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: <s.shtylyov@omp.ru>, <davem@davemloft.net>, <edumazet@google.com>,
	<kuba@kernel.org>, <pabeni@redhat.com>,
	<yoshihiro.shimoda.uh@renesas.com>, <andrew@lunn.ch>
Cc: <netdev@vger.kernel.org>, <linux-renesas-soc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH net-next] net: ethernet: renesas: rswitch: Fix signedness bug in rswitch_etha_wait_link_verification()
Date: Fri, 18 Nov 2022 14:32:40 +0800	[thread overview]
Message-ID: <20221118063240.52164-1-yuehaibing@huawei.com> (raw)

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


             reply	other threads:[~2022-11-18  6:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  6:32 YueHaibing [this message]
2022-11-18 10:01 ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221118063240.52164-1-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=s.shtylyov@omp.ru \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®