netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: hisilicon: Fix signedness bug in hix5hd2_dev_probe()
@ 2019-09-25 10:55 Dan Carpenter
  2019-09-27  8:02 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-09-25 10:55 UTC (permalink / raw)
  To: Yisen Zhuang, Zhangfei Gao
  Cc: Salil Mehta, David S. Miller, netdev, kernel-janitors

The "priv->phy_mode" variable is an enum and in this context GCC will
treat it as unsigned to the error handling will never trigger.

Fixes: 57c5bc9ad7d7 ("net: hisilicon: add hix5hd2 mac driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
index 95a6b0926170..c41b19c760f8 100644
--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
@@ -1194,7 +1194,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
 		goto err_free_mdio;
 
 	priv->phy_mode = of_get_phy_mode(node);
-	if (priv->phy_mode < 0) {
+	if ((int)priv->phy_mode < 0) {
 		netdev_err(ndev, "not find phy-mode\n");
 		ret = -EINVAL;
 		goto err_mdiobus;
-- 
2.20.1


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

* Re: [PATCH net] net: hisilicon: Fix signedness bug in hix5hd2_dev_probe()
  2019-09-25 10:55 [PATCH net] net: hisilicon: Fix signedness bug in hix5hd2_dev_probe() Dan Carpenter
@ 2019-09-27  8:02 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-09-27  8:02 UTC (permalink / raw)
  To: dan.carpenter
  Cc: yisen.zhuang, zhangfei.gao, salil.mehta, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 25 Sep 2019 13:55:32 +0300

> The "priv->phy_mode" variable is an enum and in this context GCC will
> treat it as unsigned to the error handling will never trigger.
> 
> Fixes: 57c5bc9ad7d7 ("net: hisilicon: add hix5hd2 mac driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

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

end of thread, other threads:[~2019-09-27  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 10:55 [PATCH net] net: hisilicon: Fix signedness bug in hix5hd2_dev_probe() Dan Carpenter
2019-09-27  8:02 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).