[PATCH] mm/mmap.c: Remove redundant local variables for may_expand_vm()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 7050c267d8dda220226067039d815593d2f9a874 Mon Sep 17 00:00:00 2001
From: Chen Gang <gang.chen.5i5j@xxxxxxxxx>
Date: Tue, 10 Nov 2015 05:32:38 +0800
Subject: [PATCH] mm/mmap.c: Remove redundant local variables for may_expand_vm()

After merge the related code into one line, the code is still simple and
meaningful enough.

Signed-off-by: Chen Gang <gang.chen.5i5j@xxxxxxxxx>
---
 mm/mmap.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 2ce04a6..a515260 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2988,12 +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)
+	if (mm->total_vm + npages> (rlimit(RLIMIT_AS)>> PAGE_SHIFT))
 		return 0;
 	return 1;
 }
-- 
1.9.3

 		 	   		  

Attachment: 0001-mm-mmap.c-Remove-redundant-local-variables-for-may_e.patch
Description: Binary data


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]