]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/huge_memory.c: remove unnecessary local variable ret2
authorMiaohe Lin <linmiaohe@huawei.com>
Wed, 5 May 2021 01:33:49 +0000 (18:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2021 18:27:20 +0000 (11:27 -0700)
There is no need to use a new local variable ret2 to get the return
value of handle_userfault().  Use ret directly to make code more
succinct.

Link: https://lkml.kernel.org/r/20210210072409.60587-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c

index ae907a9c20506acbe8287e57f8ac67e644c5bfed..bff92dea5ab3ec70711ec0786551fe4d5ca52ef5 100644 (file)
@@ -624,14 +624,12 @@ static vm_fault_t __do_huge_pmd_anonymous_page(struct vm_fault *vmf,
 
                /* Deliver the page fault to userland */
                if (userfaultfd_missing(vma)) {
-                       vm_fault_t ret2;
-
                        spin_unlock(vmf->ptl);
                        put_page(page);
                        pte_free(vma->vm_mm, pgtable);
-                       ret2 = handle_userfault(vmf, VM_UFFD_MISSING);
-                       VM_BUG_ON(ret2 & VM_FAULT_FALLBACK);
-                       return ret2;
+                       ret = handle_userfault(vmf, VM_UFFD_MISSING);
+                       VM_BUG_ON(ret & VM_FAULT_FALLBACK);
+                       return ret;
                }
 
                entry = mk_huge_pmd(page, vma->vm_page_prot);