net: phy: micrel: use min() macro instead of doing it manually
Subsystems (3)
PATCH 1/1 net: phy: micrel: use min() macro instead of doing it manually
Fix following coccicheck warning:
./drivers/net/phy/micrel.c:1482:12-13: WARNING opportunity for min()
Reported-by Abaci Robot <[email protected]>
Signed-off-by Yang Li <[email protected]>
--- drivers/net/phy/micrel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/micrel.c +1 -1
@@ -1479,7 +1479,7 @@ static int ksz886x_cable_test_wait_for_completion(struct phy_device *phydev) !(val &KSZ8081_LMD_ENABLE_TEST ), 30000, 100000, true); -return ret <0 ? ret :0 ; +return min (ret,0 ); }static int ksz886x_cable_test_one_pair (struct phy_device *phydev,int pair)
Signature · 1 line
2.20.1.7.g153144c
Heiner Kallweit
maintainerQuoted 3 lines · Yang Li
Fix following coccicheck warning:
./drivers/net/phy/micrel.c:1482:12-13: WARNING opportunity formin()
Please always check whether a coccicheck warning makes sense, and don't create "fixes" mechanically w/o thinking. Here using min() doesn't make sense because it's not about a numerical operation. ret < 0 is equivalent to is_err(ret).
Quoted 19 lines
Reported-by Abaci Robot <[email protected]>Signed-off-by Yang Li <[email protected]>--- drivers/net/phy/micrel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/phy/micrel.c +1
-1@@ -1479,7 +1479,7 @@ static int ksz886x_cable_test_wait_for_completion(struct phy_device *phydev) !(val &KSZ8081_LMD_ENABLE_TEST ), 30000, 100000, true); -return ret <0 ? ret :0 ; +return min (ret,0 ); }static int ksz886x_cable_test_one_pair (struct phy_device *phydev,int pair)