Re: RFC: Fix big endian MMIO primitives.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 06, 2012 at 08:01:58PM +0200, Krzysztof Halasa wrote:
> Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> writes:
> 
> > Maybe we should rather use the __raw_* variants in the cfi driver aswell
> > which is the only user of the functions below.
> 
> We can do that for the sake of compatibility with Linux.
> 
> > For some reason I
> > believed that the __raw_* variants also do little endian accesses which
> > is wrong.
> > I don't like the naming of the __raw_* variants very much as the
> > underscores and 'raw' suggests that these are internal functions which
> > one should rather not use, but in fact these are the correct functions
> > in most SoC (non PCI) drivers. Anyway, since Linux has this functions we
> > should use them aswell, everything else probably leads to more
> > confusion.
> 
> I don't know.
> 
> I would rename:
> __raw_* -> cpu_*() as they are just plain and simple accessors with
> native endianness.
> 
> readl() and friends -> le32_readl() etc.
> The 'l' is somewhat redundant, the size is already determined by '32'
> (and 16, 8). Maybe le32_read() or read_le32()?
> 
> Your call. We can just limit this renaming to cpu_* -> __raw_*.
> 
> 
> To be honest, I would like this stuff renamed in Linux as well. Perhaps
> some day.

I tend to take your patch as is. The cpu_* accessors have a clear
meaning and don't conflict with anything in Linux, so why not just have
them around. Anyway, I'll sleep over it before applying it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux