From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1871C388F7 for ; Tue, 10 Nov 2020 03:38:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5C4F222203 for ; Tue, 10 Nov 2020 03:37:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="G9OWyaea" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C4F222203 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1575D6B0082; Mon, 9 Nov 2020 22:37:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 10CC86B0083; Mon, 9 Nov 2020 22:37:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E724B6B0085; Mon, 9 Nov 2020 22:37:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id C65CE6B0082 for ; Mon, 9 Nov 2020 22:37:26 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6F5243629 for ; Tue, 10 Nov 2020 03:37:26 +0000 (UTC) X-FDA: 77467098492.26.mine24_2e0af07272f1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 4B2FE1804B660 for ; Tue, 10 Nov 2020 03:37:26 +0000 (UTC) X-HE-Tag: mine24_2e0af07272f1 X-Filterd-Recvd-Size: 3002 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 03:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=+fsPgy2FGEfkf8K6jz3MHNqzYd6pKUEDydUXAgxaiMA=; b=G9OWyaea+8mGMj/hOqRRvklnBn w+/EDAr+N6+Td+sq4O86hI3kBpt42QjzVggn10L6KXJP6wGASEf64Ikpv44rmMIPL13nWIsP/0otr mToyhct4Mbg8vVCbIf30nKYqf0pHQnx/q3ICUTy+Ly882Vzv0x9BMUwSEjL5w2U2+goVjrgarKTt9 YztJCbLMaH3F2znTsMFw5rTQIJLBp4Jp96y+cMGI1j6nXWd57Q3dDW/tucabWwwBKQ/hVcBLAHyH0 hRCOZ9QL7IGoGiaJZI/+cl0VRX4QwV5AdklwMhXkBzjtR6ed4jtcb/lYstYGZ9Z29XQHfK0AbOZNy Y3kL8/aQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcKTC-00068t-Bv; Tue, 10 Nov 2020 03:37:22 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: Christoph Hellwig , kent.overstreet@gmail.com, Matthew Wilcox Subject: [PATCH v3 18/18] mm/filemap: Simplify generic_file_read_iter Date: Tue, 10 Nov 2020 03:37:03 +0000 Message-Id: <20201110033703.23261-19-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201110033703.23261-1-willy@infradead.org> References: <20201110033703.23261-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Christoph Hellwig Avoid the pointless goto out just for returning retval. Signed-off-by: Christoph Hellwig Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Kent Overstreet --- mm/filemap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index a080200a9fa0..a09621eb8940 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2540,7 +2540,7 @@ generic_file_read_iter(struct kiocb *iocb, struct i= ov_iter *iter) ssize_t retval =3D 0; =20 if (!count) - goto out; /* skip atime */ + return 0; /* skip atime */ =20 if (iocb->ki_flags & IOCB_DIRECT) { struct file *file =3D iocb->ki_filp; @@ -2558,7 +2558,7 @@ generic_file_read_iter(struct kiocb *iocb, struct i= ov_iter *iter) iocb->ki_pos, iocb->ki_pos + count - 1); if (retval < 0) - goto out; + return retval; } =20 file_accessed(file); @@ -2581,12 +2581,10 @@ generic_file_read_iter(struct kiocb *iocb, struct= iov_iter *iter) */ if (retval < 0 || !count || iocb->ki_pos >=3D size || IS_DAX(inode)) - goto out; + return retval; } =20 - retval =3D filemap_read(iocb, iter, retval); -out: - return retval; + return filemap_read(iocb, iter, retval); } EXPORT_SYMBOL(generic_file_read_iter); =20 --=20 2.28.0