ARC: mm: do_page_fault refactor #1: remove label @good_area
authorVineet Gupta <vgupta@synopsys.com>
Tue, 14 May 2019 21:22:47 +0000 (14:22 -0700)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 1 Jul 2019 18:02:22 +0000 (11:02 -0700)
Invert the condition for stack expansion.
No functional change

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/mm/fault.c

index 8cca034..be8ea91 100644 (file)
@@ -97,21 +97,19 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
                flags |= FAULT_FLAG_USER;
 retry:
        down_read(&mm->mmap_sem);
+
        vma = find_vma(mm, address);
        if (!vma)
                goto bad_area;
-       if (vma->vm_start <= address)
-               goto good_area;
-       if (!(vma->vm_flags & VM_GROWSDOWN))
-               goto bad_area;
-       if (expand_stack(vma, address))
-               goto bad_area;
+       if (unlikely(address < vma->vm_start)) {
+               if (!(vma->vm_flags & VM_GROWSDOWN) || expand_stack(vma, address))
+                       goto bad_area;
+       }
 
        /*
         * Ok, we have a good vm_area for this memory access, so
         * we can handle it..
         */
-good_area:
        si_code = SEGV_ACCERR;
 
        /* Handle protection violation, execute on heap or stack */