linux-mips
[Top] [All Lists]

Re: [PATCH 2/2] MIPS: add readl/write_be

To: Florian Fainelli <ffainelli@freebox.fr>
Subject: Re: [PATCH 2/2] MIPS: add readl/write_be
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Date: Sat, 12 Dec 2009 20:31:14 +0100
Cc: linux-mips@linux-mips.org, Maxime Bizon <mbizon@freebox.fr>, ralf@linux-mips.org
In-reply-to: <200912121757.56365.ffainelli@freebox.fr>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <200912121757.56365.ffainelli@freebox.fr>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
On Sat, Dec 12, 2009 at 05:57:56PM +0100, Florian Fainelli wrote:
> +#define readl_be(addr)                       __raw_readl((__force unsigned 
> *)addr)
> +#define writel_be(val, addr)         __raw_writel(val, (__force unsigned 
> *)addr)

looks broken for little endian machines. __raw_XXX doesn't do any swapping,
so IMHO the correct thing would be to use be32_to_cpu/cpu_to_be32.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

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