Re: [PATCH 2/2] jz4740-battery: fix signedness bug
From: Lars-Peter Clausen
Date: Thu Dec 08 2011 - 09:08:28 EST
On 12/08/2011 02:05 PM, Axel Lin wrote:
> 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@xxxxxxxxx>
Acked-by: Lars-Peter Clausen <lars@xxxxxxxxxx>
Thanks
> ---
> drivers/power/jz4740-battery.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/power/jz4740-battery.c b/drivers/power/jz4740-battery.c
> index 763f894..5bb1ddd 100644
> --- a/drivers/power/jz4740-battery.c
> +++ b/drivers/power/jz4740-battery.c
> @@ -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;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/