Messages in this thread |  | | | Date | Thu, 2 Jul 2009 09:26:54 +0100 | | From | Ralf Baechle <> | | Subject | Re: [PATCH] Fix virt_to_phys() warnings |
On Thu, Jul 02, 2009 at 09:07:46AM +0200, Andi Kleen wrote: > From: Andi Kleen <andi@firstfloor.org> > Date: Thu, 02 Jul 2009 09:07:46 +0200 > To: Andrew Morton <akpm@linux-foundation.org> > Cc: Kevin Cernekee <cernekee@gmail.com>, linux-kernel@vger.kernel.org, > Ralf Baechle <ralf@linux-mips.org> > Subject: Re: [PATCH] Fix virt_to_phys() warnings > Content-Type: text/plain; charset=us-ascii > > Andrew Morton <akpm@linux-foundation.org> writes: > > > > #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) > > > > thereby passing an `unsigned long' where a void* was expected. > > > > > > So perhaps something along these lines: > > I'm not quite sure it's the case on MIPS, but I remember on x86 one of > the reasons this was done as a macro was to avoid a include dependency > loop with struct page.
The MIPS <asm/page.h> uses a forward declaration for the same reason since a very long time. These days struct page is defined in <linux/mm_types.h> but that file needs pgprot_t (which is defined in <asm/page.h> ...) to be defined first so can't be included from the to of page.h.
Ralf
|  |