Skip to contentSkip to conversation

ia64/mca: Fix cast from integer to pointer warning

PATCH New Jeff Mahoney 1 participant 1 message Feb 24, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ia64/mca: Fix cast from integer to pointer warning

ia64_mca_cpu_init has a void *data local variable that is assigned the value from either __get_free_pages() or mca_bootmem(). The problem is that __get_free_pages returns an unsigned long and mca_bootmem, via alloc_bootmem(), returns a void *. format_mca_init_stack takes the void *, and it's also used with __pa(), but that casts it to long anyway.

This results in the following build warning:

arch/ia64/kernel/mca.c:1898: warning: assignment makes pointer from integer without a cast

This patch casts the return of __get_free_pages to a void * to avoid the warning.

---
 arch/ia64/kernel/mca.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/ia64/kernel/mca.c +2 -1
@@ -1859,7 +1859,8 @@ ia64_mca_cpu_init(void *cpu_data)
 			data = mca_bootmem();
 			first_time = 0;
 		} else
-			data = __get_free_pages(GFP_KERNEL, get_order(sz));
+			data = (void *)__get_free_pages(GFP_KERNEL,
+							get_order(sz));
 		if (!data)
 			panic("Could not allocate MCA memory for cpu %d\n",
 					cpu);
Signature · 2 lines
Jeff Mahoney
SUSE Labs