linux-mips
[Top] [All Lists]

Re: [loongson-PATCH-v1 02/27] fix-warning: incompatible argument type of

To: wuzhangjin@gmail.com
Subject: Re: [loongson-PATCH-v1 02/27] fix-warning: incompatible argument type of virt_to_phys
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 21 May 2009 09:06:47 +0100
Cc: linux-mips@linux-mips.org, Yan hua <yanh@lemote.com>, Philippe Vachon <philippe@cowpig.ca>, Zhang Le <r0bertz@gentoo.org>, Zhang Fuxin <zhangfx@lemote.com>, Arnaud Patard <apatard@mandriva.com>, loongson-dev@googlegroups.com, gnewsense-dev@nongnu.org, Nicholas Mc Guire <hofrat@hofr.at>, Liu Junliang <liujl@lemote.com>, Erwan Lerale <erwan@thiscow.com>
In-reply-to: <0e7026092faebce7caf6bfe9807146cffcd8842a.1242855716.git.wuzhangjin@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <cover.1242855716.git.wuzhangjin@gmail.com> <0e7026092faebce7caf6bfe9807146cffcd8842a.1242855716.git.wuzhangjin@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
On Thu, May 21, 2009 at 05:49:30AM +0800, wuzhangjin@gmail.com wrote:

> mm/page_alloc.c:1760: warning: passing argument 1 of ‘virt_to_phys’
> makes pointer from integer without a cast
> 
> mm/page_alloc.c:1760
>       ...
>       unsigned long addr;
>       ...
>       split_page(virt_to_page(addr), order);
> 
> arch/mips/include/asm/page.h
> 
>       #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
>       #define virt_addr_valid(kaddr)  pfn_valid(PFN_DOWN(virt_to_phys(kaddr)))
> 
> arch/mips/include/asm/io.h
>       static inline unsigned long virt_to_phys(volatile const void *address)

I'm inclined to say the caller needs fixing.  Most callers are passing
some kind of pointer argument but here an unsigned long is being passed
in.  I'm checking with the mm maintainers.  For now I'll apply this patch
to my -mm queue.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>