[U-Boot] [PATCH V2] ppc4xx: Add 405EP based PMC405DE board

Wolfgang Denk wd at denx.de
Fri Jul 17 23:19:24 CEST 2009


Dear Matthias Fuchs,

In message <200907161205.00253.matthias.fuchs at esd.eu> you wrote:
> 
> > 	return (in_be32((void*)GPIO0_IR) & CONFIG_SYS_GPIO_MONARCH_N) == 0;
> Ack.
> > 
> > Umm... and why do we need a cast here? This should be fixed.
> The in/out_be16/32 functions expect a pointer. When you grep over the
> U-Boot sources you will find tons of places with this cast.

Right you are. These all should be fixed, too.

> So I will and cannot fix this with my patch.

Of course you can. The cure is simple:

Fix "include/ppc405.h" so we get rid of this silly  "base  address  +
offset" notation and use proper C structures instead.


Oh, and while we are at it - "include/ppc440.h" has more of this stuff
that is waiting for cleanup. But that is another story, not related to
your patch - maybe Stefan picks up this ball :-)


> We could put the cast into the GPIO_IR (and friends) definitions.

No cast is needed. Just use proper C structs.

> Do you want me to remove the cast and life with a compiler warning until
> this has been globally fixed?

No, of course not.

> Because this is not a particular problem with this patch it should be
> addressed in a separate discussion. But you are rigth - this cast is
> a little bit nerving :-)

I agree - the cleanup patch should be submitted first.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
For those who like this sort of thing, this is the sort of thing they
like.                                               - Abraham Lincoln


More information about the U-Boot mailing list