Fix virt_to_phys() warnings
authorKevin Cernekee <cernekee@gmail.com>
Sun, 5 Jul 2009 19:08:19 +0000 (12:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 6 Jul 2009 20:57:03 +0000 (13:57 -0700)
These warnings were observed on MIPS32 using 2.6.31-rc1 and gcc-4.2.0:

mm/page_alloc.c: In function 'alloc_pages_exact':
mm/page_alloc.c:1986: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast

drivers/usb/mon/mon_bin.c: In function 'mon_alloc_buff':
drivers/usb/mon/mon_bin.c:1264: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast

[akpm@linux-foundation.org: fix kernel/perf_counter.c too]
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/usb/mon/mon_bin.c
kernel/perf_counter.c
mm/page_alloc.c

index f8d9045d668a15659fadf2af3fecf374623402f5..0f7a30b7d2d16e08f7c63ddc1711833d0667fc15 100644 (file)
@@ -1261,7 +1261,7 @@ static int mon_alloc_buff(struct mon_pgmap *map, int npages)
                        return -ENOMEM;
                }
                map[n].ptr = (unsigned char *) vaddr;
-               map[n].pg = virt_to_page(vaddr);
+               map[n].pg = virt_to_page((void *) vaddr);
        }
        return 0;
 }
index d55a50da2347f5c2177d3fd5cb0f7db28a7ff71b..a641eb753b8cc92b664966e3a6932c595f07b111 100644 (file)
@@ -2020,7 +2020,7 @@ fail:
 
 static void perf_mmap_free_page(unsigned long addr)
 {
-       struct page *page = virt_to_page(addr);
+       struct page *page = virt_to_page((void *)addr);
 
        page->mapping = NULL;
        __free_page(page);
index e0f2cdf9d8b1f2a351e409a1699cd3e06dcdc200..ad7cd1c56b07c330d611a067a0749f9cabd440b0 100644 (file)
@@ -1983,7 +1983,7 @@ void *alloc_pages_exact(size_t size, gfp_t gfp_mask)
                unsigned long alloc_end = addr + (PAGE_SIZE << order);
                unsigned long used = addr + PAGE_ALIGN(size);
 
-               split_page(virt_to_page(addr), order);
+               split_page(virt_to_page((void *)addr), order);
                while (used < alloc_end) {
                        free_page(used);
                        used += PAGE_SIZE;