projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab7a5af
)
mm/mmap.c: remove redundant local variables for may_expand_vm()
author
Chen Gang
<
[email protected]
>
Thu, 14 Jan 2016 23:18:27 +0000
(15:18 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 15 Jan 2016 00:00:49 +0000
(16:00 -0800)
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]
>
mm/mmap.c
patch
|
blob
|
history
diff --git
a/mm/mmap.c
b/mm/mmap.c
index 2ce04a649f6b4977e54b76a29be9d5bac5e71dab..9da9c27c33a2a61231a39f54af0e5926af4bd98f 100644
(file)
--- 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,