max8997_charger: Fix unsigned value for less than zero
authorJonghwan Choi <jhbird.choi@gmail.com>
Fri, 28 Oct 2011 22:56:32 +0000 (07:56 +0900)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Thu, 24 Nov 2011 22:56:21 +0000 (02:56 +0400)
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>
drivers/power/max8997_charger.c

index e12b4a2a0be2a621899f7e23b970fb951a705544..6e88c5d026b93485a942c3102cf27971cd64df1f 100644 (file)
@@ -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)