From: Dan Carpenter Date: Wed, 25 Sep 2019 10:55:32 +0000 (+0300) Subject: net: hisilicon: Fix signedness bug in hix5hd2_dev_probe() X-Git-Tag: v5.4-rc1~14^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=002dfe8085255b7bf1e0758c3d195c5412d35be9;p=platform%2Fkernel%2Flinux-rpi.git net: hisilicon: Fix signedness bug in hix5hd2_dev_probe() 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c index 95a6b09..c41b19c 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;