Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b57d6ba authored by Chen Gang's avatar Chen Gang Committed by Linus Torvalds
Browse files

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: default avatarChen Gang <gang.chen.5i5j@gmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ab7a5af7
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -2988,14 +2988,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
 */
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,