net: phy: fix sign type error in genphy_config_eee_advert
authorjbrunet <jbrunet@baylibre.com>
Mon, 19 Dec 2016 15:05:36 +0000 (16:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jul 2017 12:40:19 +0000 (14:40 +0200)
[ Upstream commit 3bb9ab63276696988d8224f52db20e87194deb4b ]

In genphy_config_eee_advert, the return value of phy_read_mmd_indirect is
checked to know if the register could be accessed but the result is
assigned to a 'u32'.
Changing to 'int' to correctly get errors from phy_read_mmd_indirect.

Fixes: d853d145ea3e ("net: phy: add an option to disable EEE advertisement")
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/phy_device.c

index b14fcf6..d9ec748 100644 (file)
@@ -1155,8 +1155,8 @@ static int genphy_config_advert(struct phy_device *phydev)
  */
 static int genphy_config_eee_advert(struct phy_device *phydev)
 {
-       u32 broken = phydev->eee_broken_modes;
-       u32 old_adv, adv;
+       int broken = phydev->eee_broken_modes;
+       int old_adv, adv;
 
        /* Nothing to disable */
        if (!broken)