mtd: nand: max_retries off by one in mxc_nand

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jun 5 16:59:01 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=43950a605dc76677f0c74dcd818a57d4df040e12
Commit:     43950a605dc76677f0c74dcd818a57d4df040e12
Parent:     a755a3858f96ea7e8762ecaac451adfad45321bd
Author:     Roel Kluin <roel.kluin at gmail.com>
AuthorDate: Thu Jun 4 16:24:59 2009 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jun 5 21:33:14 2009 +0100

    mtd: nand: max_retries off by one in mxc_nand
    
    with `while (max_retries-- > 0)' max_retries reaches -1 after the loop.
    
    Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/mxc_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index d03bd4e..da41ea8 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -199,7 +199,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);
 	}



More information about the linux-mtd-cvs mailing list