linux-mips
[Top] [All Lists]

[PATCH] MIPS: in plat_time_init() t reaches -1, tested: 0

To: mano@roarinelk.homelinux.net, ralf@linux-mips.org
Subject: [PATCH] MIPS: in plat_time_init() t reaches -1, tested: 0
From: Roel Kluin <roel.kluin@gmail.com>
Date: Sat, 31 Jan 2009 12:23:34 +0100
Cc: linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=2LmWa81v45+zbl7nWPX72nrrJcGdVg8P5kR+eKzfaTE=; b=iRvdkcTTPj4eRqmzBhmHdmA4WVT7Jsd3X43ZelYxRyfl8Tbvr+1+ZfQjAVd7xIYLCd VzkKNamjTTxuAYdOEg6pa8c1OC8k1lnFMN5CkyVEDtiEeK00BIbat0kZwHaLolaKlTfQ j9vhhE+oxDyZoBHBXbkW8BQVp8SHlY6OgRrN0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=XmMPkwj+Wqr4X+GGcuKKH/FUo3sVqDLtobv28tT8dfVcq6hFkW/zEXGR05ma6JugQS phEnLthKNzg+kaYkdLCa4HYLnxxLkm4Ge3XPyenqCoz0UhrnRpMRfTA+WBFIoYUlnPCP A9Qdo++zIqUB2RrnbHsB6VbvSI71rWjwSZfV4=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.18 (X11/20081105)
With a postfix decrement t reaches -1 rather than 0,
so the fall-back will not occur.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index 3288014..0b5681a 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -118,7 +118,7 @@ void __init plat_time_init(void)
         * setup counter 1 (RTC) to tick at full speed
         */
        t = 0xffffff;
-       while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && t--)
+       while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && --t)
                asm volatile ("nop");
        if (!t)
                goto cntr_err;
@@ -127,7 +127,7 @@ void __init plat_time_init(void)
        au_sync();
 
        t = 0xffffff;
-       while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--)
+       while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t)
                asm volatile ("nop");
        if (!t)
                goto cntr_err;
@@ -135,7 +135,7 @@ void __init plat_time_init(void)
        au_sync();
 
        t = 0xffffff;
-       while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--)
+       while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t)
                asm volatile ("nop");
        if (!t)
                goto cntr_err;

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: in plat_time_init() t reaches -1, tested: 0, Roel Kluin <=