linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: carver4lio@163.com
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Hailong Liu <carver4lio@163.com>,
	Hailong Liu <liu.hailong6@zte.com.cn>
Subject: [PATCH] mm:remove the unuseful  else after a return
Date: Wed,  2 Dec 2020 23:47:20 +0800	[thread overview]
Message-ID: <20201202154720.115162-1-carver4lio@163.com> (raw)

From: Hailong Liu <carver4lio@163.com>

The *else* is not useful after a *return* in __lock_page_or_retry().

Signed-off-by: Hailong Liu<liu.hailong6@zte.com.cn>
---
 mm/filemap.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 0b2067b3c..55e6ad1b0 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1583,19 +1583,19 @@ int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
 		else
 			wait_on_page_locked(page);
 		return 0;
-	} else {
-		if (flags & FAULT_FLAG_KILLABLE) {
-			int ret;
-
-			ret = __lock_page_killable(page);
-			if (ret) {
-				mmap_read_unlock(mm);
-				return 0;
-			}
-		} else
-			__lock_page(page);
-		return 1;
 	}
+	if (flags & FAULT_FLAG_KILLABLE) {
+		int ret;
+
+		ret = __lock_page_killable(page);
+		if (ret) {
+			mmap_read_unlock(mm);
+			return 0;
+		}
+	} else
+		__lock_page(page);
+	return 1;
+
 }
 
 /**
-- 
2.17.1



                 reply	other threads:[~2020-12-02 15:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201202154720.115162-1-carver4lio@163.com \
    --to=carver4lio@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liu.hailong6@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox