aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Gang <[email protected]>2016-01-14 15:18:27 -0800
committerLinus Torvalds <[email protected]>2016-01-14 16:00:49 -0800
commit0b57d6ba0bd11a41a791cf6c5bbf3b55630dc70f (patch)
tree7ef82cb97aa0be9d50269b29098a77e4d12e0451
parentab7a5af7fd9cc38576b432690367bbabc8da99b2 (diff)
mm/mmap.c: remove redundant local variables for may_expand_vm()
Simplify may_expand_vm(). [[email protected]: further simplification, per Naoya Horiguchi] Signed-off-by: Chen Gang <[email protected]> Cc: Naoya Horiguchi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/mmap.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 2ce04a649f6b..9da9c27c33a2 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -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,