Skip to contentSkip to conversation

mtd/nand: max_retries off by one

PATCH New Roel Kluin 1 participant 1 message Jun 4, 2009

Subsystems (3)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 mtd/nand: max_retries off by one

with `while (max_retries-- > 0)' max_retries reaches -1 after the loop.

---

drivers/mtd/nand/mxc_nand.c +1 -1
index 40c2608..b9706ad 100644
@@ -192,7 +192,7 @@ static void wait_op_done(struct mxc_nand_host *host, int max_retries,
 			}
 			udelay(1);
 		}
-		if (max_retries <= 0)
+		if (max_retries < 0)
 			DEBUG(MTD_DEBUG_LEVEL0, "%s(%d): INT not set\n",
 			      __func__, param);
 	}