Commit 44abd774 authored by Jonghwan Choi's avatar Jonghwan Choi Committed by Anton Vorontsov

max8997_charger: Fix unsigned value for less than zero

The 'val' is a 'unsigned char', so it is never less than zero.
Signed-off-by: default avatarJonghwan Choi <jhbird.choi@gmail.com>
Acked-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent 47f0ac2b
...@@ -97,7 +97,7 @@ static __devinit int max8997_battery_probe(struct platform_device *pdev) ...@@ -97,7 +97,7 @@ static __devinit int max8997_battery_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
if (pdata->eoc_mA) { if (pdata->eoc_mA) {
u8 val = (pdata->eoc_mA - 50) / 10; int val = (pdata->eoc_mA - 50) / 10;
if (val < 0) if (val < 0)
val = 0; val = 0;
if (val > 0xf) if (val > 0xf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment