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: Jonghwan Choi <jhbird.choi@gmail.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
This commit is contained in:
parent
47f0ac2b0a
commit
44abd774f5
|
@ -97,7 +97,7 @@ static __devinit int max8997_battery_probe(struct platform_device *pdev)
|
|||
return -EINVAL;
|
||||
|
||||
if (pdata->eoc_mA) {
|
||||
u8 val = (pdata->eoc_mA - 50) / 10;
|
||||
int val = (pdata->eoc_mA - 50) / 10;
|
||||
if (val < 0)
|
||||
val = 0;
|
||||
if (val > 0xf)
|
||||
|
|
Loading…
Reference in New Issue