]> git.baikalelectronics.ru Git - uboot.git/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)
commit189fb5181303c3416ba6e2520a25b0e7936af7d1
tree391dcf4f7d9803cbe94fc8775b0c6aeba933ac98
parent604b6fd1d330b15203a4f954dc31a7b455a114ff
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