]> git.sur5r.net Git - u-boot/commit
drivers/power/regulator/max77686.c: Fix comparisons of unsigned expressions
authorTom Rini <trini@konsulko.com>
Wed, 10 May 2017 19:20:17 +0000 (15:20 -0400)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 29 May 2017 08:28:52 +0000 (17:28 +0900)
commitaae78fa774bf5da8d5ac0f80773283196bcb0e24
tree391dcf4f7d9803cbe94fc8775b0c6aeba933ac98
parent7ca0d3dde177fa4245f4a6174c577a58c8a3051d
drivers/power/regulator/max77686.c: Fix comparisons of unsigned expressions

Inside of
max77686_buck_volt2hex/max77686_buck_hex2volt/max77686_ldo_volt2hex we
check that the value we calculate is >= 0 however we declare 'hex' as
unsigned int making these always true.  Mark these as 'int' instead.  We
also move hex_max to int as they are constants that are 0x3f/0xff.
Given that the above functions are marked as returning an int, make the
variables we assign their return value to also be int to be able to
catch the error condition now.  Reported by clang-3.8.

Cc: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
drivers/power/regulator/max77686.c