Skip to content

Commit

Permalink
[ARM] AACI: timeout will reach -1
Browse files Browse the repository at this point in the history
With a postfix decrement the timeout will reach -1 rather than 0,
so the warning will not be issued.

Signed-off-by: Roel Kluin <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
RoelKluin authored and Russell King committed Feb 10, 2009
1 parent e0fc4f9 commit f6f35bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/arm/aaci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down

0 comments on commit f6f35bb

Please sign in to comment.