]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mm/filemap.c: remove else after a return
authorHailong Liu <carver4lio@163.com>
Tue, 15 Dec 2020 03:05:02 +0000 (19:05 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Dec 2020 20:13:38 +0000 (12:13 -0800)
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>
mm/filemap.c

index b31e232fdd459b53b929aad02ad8c3dd28a4a765..343ba8571ff957dce77d4284762f52f82d51cf1f 100644 (file)
@@ -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;
+
 }
 
 /**