[ARM] AACI: timeout will reach -1
authorRoel Kluin <roel.kluin@gmail.com>
Sun, 8 Feb 2009 14:22:25 +0000 (15:22 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 10 Feb 2009 09:59:20 +0000 (09:59 +0000)
With a postfix decrement the timeout will reach -1 rather than 0,
so the warning will not be issued.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
sound/arm/aaci.c

index 89096e8..772901e 100644 (file)
@@ -90,7 +90,7 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
         */
        do {
                v = readl(aaci->base + AACI_SLFR);
-       } while ((v & (SLFR_1TXB|SLFR_2TXB)) && timeout--);
+       } while ((v & (SLFR_1TXB|SLFR_2TXB)) && --timeout);
 
        if (!timeout)
                dev_err(&aaci->dev->dev,
@@ -126,7 +126,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
         */
        do {
                v = readl(aaci->base + AACI_SLFR);
-       } while ((v & SLFR_1TXB) && timeout--);
+       } while ((v & SLFR_1TXB) && --timeout);
 
        if (!timeout) {
                dev_err(&aaci->dev->dev, "timeout on slot 1 TX busy\n");
@@ -147,7 +147,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
        do {
                cond_resched();
                v = readl(aaci->base + AACI_SLFR) & (SLFR_1RXV|SLFR_2RXV);
-       } while ((v != (SLFR_1RXV|SLFR_2RXV)) && timeout--);
+       } while ((v != (SLFR_1RXV|SLFR_2RXV)) && --timeout);
 
        if (!timeout) {
                dev_err(&aaci->dev->dev, "timeout on RX valid\n");