linux-mips
[Top] [All Lists]

Re: [PATCH] Always use virt_to_phys() when translating kernel addresses

To: Franck Bui-Huu <vagabon.xyz@gmail.com>
Subject: Re: [PATCH] Always use virt_to_phys() when translating kernel addresses [take #2]
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 19 Mar 2007 22:28:14 +0000
Cc: mbizon@freebox.fr, linux-mips <linux-mips@linux-mips.org>
In-reply-to: <45FEBC1A.8070604@innova-card.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <45FE5ADA.3030309@innova-card.com> <1174320169.32046.113.camel@sakura.staff.proxad.net> <cda58cb80703190916g7851000dn7defeaa09eb038f@mail.gmail.com> <45FEBC1A.8070604@innova-card.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.2i
On Mon, Mar 19, 2007 at 05:36:42PM +0100, Franck Bui-Huu wrote:

> diff --git a/include/asm-mips/mach-generic/dma-coherence.h 
> b/include/asm-mips/mach-generic/dma-coherence.h
> index 76e04e7..3a2ac54 100644
> --- a/include/asm-mips/mach-generic/dma-coherence.h
> +++ b/include/asm-mips/mach-generic/dma-coherence.h
> @@ -28,6 +28,13 @@ static inline unsigned long 
> plat_dma_addr_to_phys(dma_addr_t dma_addr)
>       return dma_addr;
>  }
>  
> +static inline unsigned long plat_dma_addr_to_virt(dma_addr_t dma_addr)
> +{
> +     unsigned long addr = plat_dma_addr_to_phys(dma_addr);
> +
> +     return (unsigned long)phys_to_virt(addr);
> +}
> +

Putting this function into include/asm-mips/mach-generic/dma-coherence.h
breaks the build for all machines that don't include this header.  I
applied your patch with this issue fixed.

  Ralf

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