Skip to content

Commit

Permalink
jz4740-battery: Fix signedness bug
Browse files Browse the repository at this point in the history
wait_for_completion_interruptible_timeout() may return negative value.
In this case, checking if (t > 0)  will return true if t is unsigned.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Axel Lin authored and Anton Vorontsov committed Jan 6, 2012
1 parent 2530daa commit ef7906f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/jz4740-battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static irqreturn_t jz_battery_irq_handler(int irq, void *devid)

static long jz_battery_read_voltage(struct jz_battery *battery)
{
unsigned long t;
long t;
unsigned long val;
long voltage;

Expand Down

0 comments on commit ef7906f

Please sign in to comment.