mirror of https://gitee.com/openkylin/linux.git
net: phy: fix less than zero comparison with unsigned variable val
The unsigned variable val is being checked for an error by checking
if it is less than zero. This can never occur because val is unsigned.
Fix this by making val a plain int.
Addresses-Coverity: ("Unsigned compared against zero")
Fixes: bdbdac7649
("ethtool: provide UAPI for PHY master/slave configuration.")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ca7e3edc22
commit
3a13f98b4c
|
@ -1948,7 +1948,7 @@ static int genphy_setup_master_slave(struct phy_device *phydev)
|
|||
static int genphy_read_master_slave(struct phy_device *phydev)
|
||||
{
|
||||
int cfg, state;
|
||||
u16 val;
|
||||
int val;
|
||||
|
||||
if (!phydev->is_gigabit_capable) {
|
||||
phydev->master_slave_get = MASTER_SLAVE_CFG_UNSUPPORTED;
|
||||
|
|
Loading…
Reference in New Issue