Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[powerpc.git] / fs / jffs2 / erase.c
index f81148a..a1db918 100644 (file)
@@ -38,8 +38,8 @@ static void jffs2_erase_block(struct jffs2_sb_info *c,
 #ifdef __ECOS
        ret = jffs2_flash_erase(c, jeb);
        if (!ret) {
-               jffs2_erase_succeeded(c, jeb);
-               return;
+              jffs2_erase_succeeded(c, jeb);
+              return;
        }
        bad_offset = jeb->offset;
 #else /* Linux */
@@ -340,7 +340,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
                if (retlen < c->sector_size) {
                        /* Don't muck about if it won't let us point to the whole erase sector */
                        D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", retlen));
-                       c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size);
+                       c->mtd->unpoint(c->mtd, ebuf, jeb->offset, retlen);
                        goto do_flash_read;
                }
                wordebuf = ebuf-sizeof(*wordebuf);
@@ -351,7 +351,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
                } while(--retlen);
                c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size);
                if (retlen)
-                       printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n",
+                       printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08tx\n",
                               *wordebuf, jeb->offset + c->sector_size-retlen*sizeof(*wordebuf));
                return 0;
        }
@@ -401,7 +401,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
 {
        size_t retlen;
        int ret;
-       uint32_t bad_offset;
+       uint32_t uninitialized_var(bad_offset);
 
        switch (jffs2_block_check_erase(c, jeb, &bad_offset)) {
        case -EAGAIN:   goto refile;