Re: [mmotm:master 185/397] mm/nommu.c:1193:8: warning: assignment makes pointer from integer without a cast

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

 



On Thu, Nov 27, 2014 at 08:20:35AM +0800, kbuild test robot wrote:
> tree:   git://git.cmpxchg.org/linux-mmotm.git master
> head:   a2d887dee78e23dc092ff14ae2ad22592437a328
> commit: cd4687a1102a69d9045d09e0af6bb9bacfb49ee5 [185/397] mm/nommu: use alloc_pages_exact() rather than it's own implementation
> config: m32r-m32104ut_defconfig (attached as .config)
> reproduce:
>   wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>   chmod +x ~/bin/make.cross
>   git checkout cd4687a1102a69d9045d09e0af6bb9bacfb49ee5
>   # save the attached .config to linux build tree
>   make.cross ARCH=m32r 
> 
> All warnings:
> 
>    mm/nommu.c: In function 'do_mmap_private':
> >> mm/nommu.c:1193:8: warning: assignment makes pointer from integer without a cast
>       base = __get_free_pages(GFP_KERNEL, order);
>            ^
> 
> vim +1193 mm/nommu.c
> 
>   1177		/* allocate some memory to hold the mapping
>   1178		 * - note that this may not return a page-aligned address if the object
>   1179		 *   we're allocating is smaller than a page
>   1180		 */
>   1181		order = get_order(len);
>   1182		kdebug("alloc order %d for %lx", order, len);
>   1183	
>   1184		total = 1 << order;
>   1185		point = len >> PAGE_SHIFT;
>   1186	
>   1187		/* we don't want to allocate a power-of-2 sized page set */
>   1188		if (sysctl_nr_trim_pages && total - point >= sysctl_nr_trim_pages) {
>   1189			total = point;
>   1190			kdebug("try to alloc exact %lu pages", total);
>   1191			base = alloc_pages_exact(len, GFP_KERNEL);
>   1192		} else {
> > 1193			base = __get_free_pages(GFP_KERNEL, order);
>   1194		}

This will fix the warning.
Thanks.

----------->8-------------------
>From 19893f8b8b02ba52e48bf2c6e387ac1646cbe6ea Mon Sep 17 00:00:00 2001
From: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
Date: Thu, 27 Nov 2014 11:17:38 +0900
Subject: [PATCH] mm/nommu: use alloc_pages_exact rather than it's own
 implementation fix

Fix following warning from 0-day kernel test infrastructure.

  make.cross ARCH=m32r

All warnings:

   mm/nommu.c: In function 'do_mmap_private':
>> mm/nommu.c:1193:8: warning: assignment makes pointer (snip)...
      base = __get_free_pages(GFP_KERNEL, order);
           ^

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
---
 mm/nommu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/nommu.c b/mm/nommu.c
index 1b87c17..099cc72 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1190,7 +1190,7 @@ static int do_mmap_private(struct vm_area_struct *vma,
 		kdebug("try to alloc exact %lu pages", total);
 		base = alloc_pages_exact(len, GFP_KERNEL);
 	} else {
-		base = __get_free_pages(GFP_KERNEL, order);
+		base = (void *)__get_free_pages(GFP_KERNEL, order);
 	}
 
 	if (!base)
-- 
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[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]