LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] UBIFS: simplify returns
@ 2015-03-11 17:44 Fabian Frederick
2015-03-12 10:20 ` Geert Uytterhoeven
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-03-11 17:44 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, Artem Bityutskiy, Adrian Hunter, linux-mtd
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>
---
fs/ubifs/recovery.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index c640938..a2e1f7f 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -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);
}
/**
@@ -1002,13 +999,9 @@ static int clean_an_unclean_leb(struct ubifs_info *c,
dbg_rcvry("LEB %d len %d", lnum, len);
- if (len == 0) {
+ 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);
if (err && err != -EBADMSG)
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1 linux-next] UBIFS: simplify returns
2015-03-11 17:44 [PATCH 1/1 linux-next] UBIFS: simplify returns Fabian Frederick
@ 2015-03-12 10:20 ` Geert Uytterhoeven
0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2015-03-12 10:20 UTC (permalink / raw)
To: Fabian Frederick
Cc: linux-kernel, Artem Bityutskiy, Adrian Hunter, MTD Maling List
Hi Fabian,
On Wed, Mar 11, 2015 at 6:44 PM, Fabian Frederick <fabf@skynet.be> wrote:
> @@ -1002,13 +999,9 @@ static int clean_an_unclean_leb(struct ubifs_info *c,
>
> dbg_rcvry("LEB %d len %d", lnum, len);
>
> - if (len == 0) {
> + 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);
While technically the curly braces are no longer needed, I'd keep them
because of the comment line.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-12 10:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 17:44 [PATCH 1/1 linux-next] UBIFS: simplify returns Fabian Frederick
2015-03-12 10:20 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).