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:
f6d4800
)
mm, vmalloc: use clamp() to simplify code
author
Zhang Yanfei
<
[email protected]
>
Wed, 3 Jul 2013 22:04:50 +0000
(15:04 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 3 Jul 2013 23:07:40 +0000
(16:07 -0700)
Signed-off-by: Zhang Yanfei <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/vmalloc.c
patch
|
blob
|
history
diff --git
a/mm/vmalloc.c
b/mm/vmalloc.c
index bd60bffd9aefc08bee5c66a8c7e0b953a051d498..91a10472a39a833b29ae0be1faeb6c30c72c0160 100644
(file)
--- a/
mm/vmalloc.c
+++ b/
mm/vmalloc.c
@@
-1330,16
+1330,8
@@
static struct vm_struct *__get_vm_area_node(unsigned long size,
struct vm_struct *area;
BUG_ON(in_interrupt());
- if (flags & VM_IOREMAP) {
- int bit = fls(size);
-
- if (bit > IOREMAP_MAX_ORDER)
- bit = IOREMAP_MAX_ORDER;
- else if (bit < PAGE_SHIFT)
- bit = PAGE_SHIFT;
-
- align = 1ul << bit;
- }
+ if (flags & VM_IOREMAP)
+ align = 1ul << clamp(fls(size), PAGE_SHIFT, IOREMAP_MAX_ORDER);
size = PAGE_ALIGN(size);
if (unlikely(!size))