It is unlikely that an inaccessible VMA without required permission flags
will get a page fault.  Hence lets just append unlikely() directive to
such checks in order to improve performance while also standardizing it
across various platforms.
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Link: http://lkml.kernel.org/r/1582525304-32113-1-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
 
                if (!(vma->vm_flags & VM_WRITE))
                        goto bad_area;
        } else {
-               if (!vma_is_accessible(vma))
+               if (unlikely(!vma_is_accessible(vma)))
                        goto bad_area;
        }
 
 
                case 1:         /* read, present */
                        goto acc_err;
                case 0:         /* read, not present */
-                       if (!vma_is_accessible(vma))
+                       if (unlikely(!vma_is_accessible(vma)))
                                goto acc_err;
        }
 
 
                                goto bad_area;
                        }
                } else {
-                       if (!vma_is_accessible(vma))
+                       if (unlikely(!vma_is_accessible(vma)))
                                goto bad_area;
                }
        }