Skip to contentSkip to conversation

spi: limit reaches -1, tested 0

PATCH New Roel Kluin 1 participant 1 message Jan 31, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 spi: limit reaches -1, tested 0

With a postfix decrement limit will reach -1 rather than 0, so the warning will not be issued.

---

drivers/spi/spi_imx.c +1 -1
index 269a55e..a4652f1 100644
@@ -779,7 +779,7 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data)
 
 			/* Read trailing bytes */
 			limit = loops_per_jiffy << 1;
-			while ((read(drv_data) == 0) && limit--);
+			while ((read(drv_data) == 0) && --limit);
 
 			if (limit == 0)
 				dev_err(&drv_data->pdev->dev,

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword