]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: realtek: net: Fix less than zero comparison of a u16
authorColin Ian King <colin.king@canonical.com>
Wed, 9 Jun 2021 17:17:48 +0000 (18:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jun 2021 22:32:08 +0000 (15:32 -0700)
commit023cccf5649f4070391aa84e31acc616743256ad
tree63b57b71ca26fa1421f103862b2aa91f159f2363
parentd8f622df7a1d180aa4965790315b86a28c366124
net: phy: realtek: net: Fix less than zero comparison of a u16

The comparisons of the u16 values priv->phycr1 and priv->phycr2 to less
than zero always false because they are unsigned. Fix this by using an
int for the assignment and less than zero check.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 6b649951f052 ("net: phy: realtek: add dt property to disable CLKOUT clock")
Fixes: a9983c1c804d ("net: phy: realtek: add dt property to enable ALDPS mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/realtek.c