From: Jonghwan Choi Date: Fri, 28 Oct 2011 22:56:32 +0000 (+0900) Subject: max8997_charger: Fix unsigned value for less than zero X-Git-Tag: firefly_0821_release~3680^2~3750^2~45 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=44abd774f52999125d499aed17a2f70211c34dcd;p=firefly-linux-kernel-4.4.55.git 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 Acked-by: MyungJoo Ham Signed-off-by: Anton Vorontsov --- diff --git a/drivers/power/max8997_charger.c b/drivers/power/max8997_charger.c index e12b4a2a0be2..6e88c5d026b9 100644 --- a/drivers/power/max8997_charger.c +++ b/drivers/power/max8997_charger.c @@ -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)