UBIFS: simplify returns
authorFabian Frederick <fabf@skynet.be>
Thu, 12 Mar 2015 20:34:21 +0000 (21:34 +0100)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 25 Mar 2015 09:08:41 +0000 (11:08 +0200)
Directly return recover_head() and ubifs_leb_unmap()
instead of storing value in err and testing it.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
fs/ubifs/recovery.c

index c640938f62f0666cf8c4b2b0e3006ed01f5cd75d..13ca4dbc4d190aa40ada5c3baebb1f495cf06b2e 100644 (file)
@@ -975,11 +975,8 @@ int ubifs_recover_inl_heads(struct ubifs_info *c, void *sbuf)
                return err;
 
        dbg_rcvry("checking LPT head at %d:%d", c->nhead_lnum, c->nhead_offs);
-       err = recover_head(c, c->nhead_lnum, c->nhead_offs, sbuf);
-       if (err)
-               return err;
 
-       return 0;
+       return recover_head(c, c->nhead_lnum, c->nhead_offs, sbuf);
 }
 
 /**
@@ -1004,10 +1001,7 @@ static int clean_an_unclean_leb(struct ubifs_info *c,
 
        if (len == 0) {
                /* Nothing to read, just unmap it */
-               err = ubifs_leb_unmap(c, lnum);
-               if (err)
-                       return err;
-               return 0;
+               return ubifs_leb_unmap(c, lnum);
        }
 
        err = ubifs_leb_read(c, lnum, buf, offs, len, 0);