mm/mmap.c: remove redundant local variables for may_expand_vm()

Simplify may_expand_vm().

[akpm@linux-foundation.org: further simplification, per Naoya Horiguchi]
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Chen Gang 2016-01-14 15:18:27 -08:00 committed by Linus Torvalds
parent ab7a5af7fd
commit 0b57d6ba0b

View File

@ -2988,14 +2988,7 @@ out:
*/
int may_expand_vm(struct mm_struct *mm, unsigned long npages)
{
unsigned long cur = mm->total_vm; /* pages */
unsigned long lim;
lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT;
if (cur + npages > lim)
return 0;
return 1;
return mm->total_vm + npages <= rlimit(RLIMIT_AS) >> PAGE_SHIFT;
}
static int special_mapping_fault(struct vm_area_struct *vma,