* [PATCH] mm:remove the unuseful else after a return
@ 2020-12-02 15:47 carver4lio
0 siblings, 0 replies; only message in thread
From: carver4lio @ 2020-12-02 15:47 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, Hailong Liu, Hailong Liu
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-02 16:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 15:47 [PATCH] mm:remove the unuseful else after a return carver4lio
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).