Skip to contentSkip to conversation

ASoC: count reaches 10001, not 10000.

PATCH In review Roel Kluin 3 participants 3 messages Feb 8, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 ASoC: count reaches 10001, not 10000.

With a postfix increment count reaches 10001, not 10000.

sound/soc/blackfin/bf5xx-ad73311.c +2 -2
index 7f2a5e1..edfbdc0 100644
@@ -114,7 +114,7 @@ static int snd_ad73311_configure(void)
 	SSYNC();
 
 	/* When TUVF is set, the data is already send out */
-	while (!(status & TUVF) && count++ < 10000) {
+	while (!(status & TUVF) && ++count < 10000) {
 		udelay(1);
 		status = bfin_read_SPORT_STAT();
 		SSYNC();
@@ -123,7 +123,7 @@ static int snd_ad73311_configure(void)
 	SSYNC();
 	local_irq_enable();
 
-	if (count == 10000) {
+	if (count >= 10000) {
 		printk(KERN_ERR "ad73311: failed to configure codec\n");
 		return -1;
 	}
#1 lore raw
Quoted 2 lines · Roel Kluin

With a postfix increment count reaches 10001, not 10000.

Thanks a lot, it looks fine for me. Add Cliff to this email, since he is maintaining this driver.

-Bryan

Quoted 23 lines
sound/soc/blackfin/bf5xx-ad73311.c +2 -2
index 7f2a5e1..edfbdc0 100644
@@ -114,7 +114,7 @@ static int snd_ad73311_configure(void)
       SSYNC();
 
       /* When TUVF is set, the data is already send out */
-       while (!(status & TUVF) && count++ < 10000) {
+       while (!(status & TUVF) && ++count < 10000) {
               udelay(1);
               status = bfin_read_SPORT_STAT();
               SSYNC();
@@ -123,7 +123,7 @@ static int snd_ad73311_configure(void)
       SSYNC();
       local_irq_enable();
 
-       if (count == 10000) {
+       if (count >= 10000) {
               printk(KERN_ERR "ad73311: failed to configure codec\n");
               return -1;
       }
#2 lore raw
In reply to Roel Kluin
Quoted 1 line · Roel Kluin

With a postfix increment count reaches 10001, not 10000.

Applied since it's very small but please try to remember to provide a signed-off-by for your commits.