Skip to contentSkip to conversation

mfd: tries reaches -1

PATCH Applied Roel Kluin 3 participants 3 messages Jan 29, 2009 – Feb 6, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 mfd: tries reaches -1

With a postfix decrement tries will reach -1 rather than 0, so the warning will not be issued even upon timeout.

---

drivers/mfd/wm8350-core.c +1 -1
index f92595c..2e0e5c2 100644
@@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref)
 	do {
 		schedule_timeout_interruptible(1);
 		reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1);
-	} while (tries-- && (reg & WM8350_AUXADC_POLL));
+	} while (--tries && (reg & WM8350_AUXADC_POLL));
 
 	if (!tries)
 		dev_err(wm8350->dev, "adc chn %d read timeout\n", channel);
#2 lore raw
In reply to Roel Kluin
Quoted 2 lines · Roel Kluin

With a postfix decrement tries will reach -1 rather than 0, so the warning will not be issued even upon timeout.

Thanks Roel, applied.

Quoted 16 lines

---

drivers/mfd/wm8350-core.c +1 -1
index f92595c..2e0e5c2 100644
@@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref)
 	do {
 		schedule_timeout_interruptible(1);
 		reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1);
-	} while (tries-- && (reg & WM8350_AUXADC_POLL));
+	} while (--tries && (reg & WM8350_AUXADC_POLL));
 
 	if (!tries)
 		dev_err(wm8350->dev, "adc chn %d read timeout\n", channel);
Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/