From patchwork Thu Mar 12 20:34:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 449647 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9E2F714007F for ; Fri, 13 Mar 2015 07:36:39 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YW9ok-00052U-UT; Thu, 12 Mar 2015 20:34:54 +0000 Received: from mailrelay116.isp.belgacom.be ([195.238.20.143]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YW9oh-0004o8-Ka for linux-mtd@lists.infradead.org; Thu, 12 Mar 2015 20:34:52 +0000 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=Ax9Kd9og7W2htzcJF9odWb+87PP6pPoG1t8Q07ebhfo= c=1 sm=2 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=OHAaWIYZilBwteWFFaAA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CsCwAf9wFV/9w8tFtbgwaBLLBPCAMFAXaMC4tvgTFNAQEBAQEBfYQ9LyOBGjeIMwHMPyyGCol+HYQXBZoFgRqFfIxnI4FFATwcgVE9MYJDAQEB Received: from 220.60-180-91.adsl-dyn.isp.belgacom.be (HELO localhost.home.) ([91.180.60.220]) by relay.skynet.be with ESMTP; 12 Mar 2015 21:34:26 +0100 From: Fabian Frederick To: linux-kernel@vger.kernel.org Subject: [PATCH V2 linux-next] UBIFS: simplify returns Date: Thu, 12 Mar 2015 21:34:21 +0100 Message-Id: <1426192461-16011-1-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150312_133451_859221_E85CDDD2 X-CRM114-Status: UNSURE ( 6.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.238.20.143 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [195.238.20.143 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Cc: Fabian Frederick , linux-mtd@lists.infradead.org, geert@linux-m68k.org, Adrian Hunter , Artem Bityutskiy X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org directly return recover_head() and ubifs_leb_unmap() instead of storing value in err and testing it. Signed-off-by: Fabian Frederick Acked-by: Geert Uytterhoeven --- V2: Keep curly braces around comment + 1 line in if. (suggested by Geert Uytterhoeven) fs/ubifs/recovery.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index c640938..13ca4db 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); } /** @@ -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);