Re: [PATCH] rtc: t reaches -1, tested 0

From: Manuel Lauss
Date: Sun Feb 08 2009 - 13:29:54 EST


Hey Roel,

On Sun, 08 Feb 2009 15:10:30 +0100
Roel Kluin <roel.kluin@xxxxxxxxx> wrote:
> With a postfix decrement t will reach -1 rather than 0,
> so the warning nor errot_out occur.
>
> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
> ---
> diff --git a/drivers/rtc/rtc-au1xxx.c b/drivers/rtc/rtc-au1xxx.c
> index 8906a68..979ed04 100644
> --- a/drivers/rtc/rtc-au1xxx.c
> +++ b/drivers/rtc/rtc-au1xxx.c
> @@ -81,7 +81,7 @@ static int __devinit au1xtoy_rtc_probe(struct platform_device *pdev)
> if (au_readl(SYS_TOYTRIM) != 32767) {
> /* wait until hardware gives access to TRIM register */
> t = 0x00100000;
> - while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S) && t--)
> + while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S) && --t)
> msleep(1);
>
> if (!t) {

Thank you, obviously correct.

Acked-by: Manuel Lauss <mano@xxxxxxxxxxxxxxxxxxxxxxx>
--
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/