Skip to content
Commit aae78fa7 authored by Tom Rini's avatar Tom Rini Committed by Jaehoon Chung
Browse files

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: default avatarTom Rini <trini@konsulko.com>
parent 7ca0d3dd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment