Skip to contentSkip to conversation

arch/unicore32/kernel/module.c: use __vmalloc_node_range() instead of __vmalloc_area()

PATCH In review Chen Gang 2 participants 2 messages Mar 14, 2014 – Mar 22, 2014

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 arch/unicore32/kernel/module.c: use __vmalloc_node_range() instead of __vmalloc_area()

__vmalloc_area() has already been removed from upstream kernel, need use __vmalloc_node_range() instead of.

The related commit: "d0a2126 mm: unify module_alloc code for vmalloc".

The related error (allmodconfig for unicore32):

CC arch/unicore32/kernel/module.o
arch/unicore32/kernel/module.c: In function ‘module_alloc’:
arch/unicore32/kernel/module.c:34: error: implicit declaration of function ‘__vmalloc_area’ arch/unicore32/kernel/module.c:34: warning: return makes pointer from integer without a cast make[1]: *** [arch/unicore32/kernel/module.o] Error 1
make: *** [arch/unicore32/kernel] Error 2

---
 arch/unicore32/kernel/module.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/unicore32/kernel/module.c +3 -8
index 16bd149..dc41f6d 100644
@@ -24,14 +24,9 @@
 
 void *module_alloc(unsigned long size)
 {
-	struct vm_struct *area;
-
-	size = PAGE_ALIGN(size);
-	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
-	if (!area)
-		return NULL;
-
-	return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC);
+	return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
+				GFP_KERNEL, PAGE_KERNEL_EXEC, NUMA_NO_NODE,
+				__builtin_return_address(0));
 }
 
 int
Signature · 1 line
1.7.9.5
Tested-by Zhichuang Sun Acked-by on v1 1/1
#1 lore raw

Thanks Chen.

Quoted 44 lines · ----- Chen Gang

__vmalloc_area() has already been removed from upstream kernel, need use __vmalloc_node_range() instead of.

The related commit: "d0a2126 mm: unify module_alloc code for vmalloc".

The related error (allmodconfig for unicore32):

CC arch/unicore32/kernel/module.o
arch/unicore32/kernel/module.c: In function ‘module_alloc’:
arch/unicore32/kernel/module.c:34: error: implicit declaration of function ‘__vmalloc_area’ arch/unicore32/kernel/module.c:34: warning: return makes pointer from integer without a cast make[1]: *** [arch/unicore32/kernel/module.o] Error 1
make: *** [arch/unicore32/kernel] Error 2

---
 arch/unicore32/kernel/module.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/unicore32/kernel/module.c +3 -8
index 16bd149..dc41f6d 100644
@@ -24,14 +24,9 @@
 
 void *module_alloc(unsigned long size)
 {
-	struct vm_struct *area;
-
-	size = PAGE_ALIGN(size);
-	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
-	if (!area)
-		return NULL;
-
-	return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC);
+	return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
+				GFP_KERNEL, PAGE_KERNEL_EXEC, NUMA_NO_NODE,
+				__builtin_return_address(0));
 }
 
 int
Signature · 1 line
1.7.9.5