[MTD] [NAND] Work around false compiler warning in CAFÉ driver
authorAndrew Morton <akpm@linux-foundation.org>
Sun, 18 Feb 2007 00:02:11 +0000 (16:02 -0800)
committerDavid Woodhouse <dwmw2@infradead.org>
Sun, 18 Feb 2007 16:45:05 +0000 (16:45 +0000)
drivers/mtd/nand/cafe.c: In function 'cafe_nand_cmdfunc':
drivers/mtd/nand/cafe.c:269: warning: 'irqs' may be used uninitialized in this function

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/nand/cafe.c

index 1e877cbe775743e30ccdd57512e2271d102088a4..5ec82beb49dfc48df4ff5933042b7e55401ccd40 100644 (file)
@@ -265,10 +265,10 @@ static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command,
        ndelay(100);
 
        if (1) {
-               int c = 500000;
+               int c;
                uint32_t irqs;
 
-               while (c--) {
+               for (c = 500000; c != 0; c--) {
                        irqs = cafe_readl(cafe, NAND_IRQ);
                        if (irqs & doneint)
                                break;