“b340c656af6317e28b466996a72cca019d97b42d”上不存在“arch/git@gitcode.net:openanolis/cloud-kernel.git”
提交 f6f35bbe 编写于 作者: R Roel Kluin 提交者: Russell King

[ARM] AACI: timeout will reach -1

With a postfix decrement the timeout will reach -1 rather than 0,
so the warning will not be issued.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 e0fc4f97
...@@ -90,7 +90,7 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, ...@@ -90,7 +90,7 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
*/ */
do { do {
v = readl(aaci->base + AACI_SLFR); v = readl(aaci->base + AACI_SLFR);
} while ((v & (SLFR_1TXB|SLFR_2TXB)) && timeout--); } while ((v & (SLFR_1TXB|SLFR_2TXB)) && --timeout);
if (!timeout) if (!timeout)
dev_err(&aaci->dev->dev, dev_err(&aaci->dev->dev,
...@@ -126,7 +126,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg) ...@@ -126,7 +126,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
*/ */
do { do {
v = readl(aaci->base + AACI_SLFR); v = readl(aaci->base + AACI_SLFR);
} while ((v & SLFR_1TXB) && timeout--); } while ((v & SLFR_1TXB) && --timeout);
if (!timeout) { if (!timeout) {
dev_err(&aaci->dev->dev, "timeout on slot 1 TX busy\n"); 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) ...@@ -147,7 +147,7 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
do { do {
cond_resched(); cond_resched();
v = readl(aaci->base + AACI_SLFR) & (SLFR_1RXV|SLFR_2RXV); 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) { if (!timeout) {
dev_err(&aaci->dev->dev, "timeout on RX valid\n"); dev_err(&aaci->dev->dev, "timeout on RX valid\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册