]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: at803x: Avoid comparison is always false warning
authorAndrew Lunn <andrew@lunn.ch>
Tue, 7 Jul 2020 01:49:33 +0000 (03:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Jul 2020 19:47:10 +0000 (12:47 -0700)
commit17c46b2d8a9900d7bc312965af3084500d1dfd0c
tree3908ae82700cb13a260e358e8a21c2dd42f6f94c
parent814f2f15225b695f917fe860b53cf16223c09faa
net: phy: at803x: Avoid comparison is always false warning

By placing the GENMASK value into an unsigned int and then passing it
to PREF_FIELD, the type is reduces down from ULL. Given the reduced
size of the type, the range checks in PREP_FAIL() are always true, and
-Wtype-limits then gives a warning.

By skipping the intermediate variable, the warning can be avoided.

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/at803x.c