summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHailong Liu <carver4lio@163.com>2020-12-14 19:05:02 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-15 12:13:38 -0800
commit800bca7c56023c2a89fe9a206a56f3788b54f767 (patch)
treebbe0f0587c8d9c31393d99caab9cde2b61050322
parent649c6dfed0302620a191ca91196d923463cfa766 (diff)
downloadlinux-800bca7c56023c2a89fe9a206a56f3788b54f767.tar.bz2
mm/filemap.c: remove else after a return
The `else' is not useful after a `return' in __lock_page_or_retry(). [akpm@linux-foundation.org: coding style fixes] Link: https://lkml.kernel.org/r/20201202154720.115162-1-carver4lio@163.com Signed-off-by: Hailong Liu<liu.hailong6@zte.com.cn> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/filemap.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index b31e232fdd45..343ba8571ff9 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1583,19 +1583,20 @@ 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;
+ }
+ 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;
+ ret = __lock_page_killable(page);
+ if (ret) {
+ mmap_read_unlock(mm);
+ return 0;
+ }
+ } else {
+ __lock_page(page);
}
+ return 1;
+
}
/**