[PATCH 16/20] imx27: define and use MX27_IO_ADDRESS

Lothar Waßmann LW at KARO-electronics.de
Thu Dec 17 06:49:42 EST 2009


Hi,

Uwe Kleine-König writes:
> Hello Lother,
> 
Lothar
    ^
> On Thu, Dec 17, 2009 at 08:06:36AM +0100, Lothar Waßmann wrote:
> > > +#define MX27_IO_ADDRESS(x)						\
> > > +	(void __force __iomem *) ( 					\
> > > +	IMX_IO_ADDRESS(x, MX27_AIPI) ?:					\
> > > +	IMX_IO_ADDRESS(x, MX27_SAHB1) ?:				\
> > > +	IMX_IO_ADDRESS(x, MX27_X_MEMC) ?:				\
> > > +	0xdeadbeef)
> >         ^^^^^^^^^^
> > I prefer to have a plain '0' here. Otherwise an invocation of this
> > macro with an illegal address could lead to silent corruption of
> > memory that happens to be mapped at that virtual address instead of a
> > kernel oops due to a null pointer dereference!
> > 
> > Same for the other processors.
> I'm a bit undecided here.  I choosed 0xdeadbeef because it is used in
>
0xdeadbeef by itself may look suspicious if you find it in some crash
dump. But if some offset is added to it, you cannot distinguish it
from any other legal virtual address.

> IO_ADDRESS, too.  It's not aligned, so probably nothing happens.  As
>
Then, that macro should be changed also. And for the alignment
argument, memory can also be accessed bytewise.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________



More information about the linux-arm-kernel mailing list