
Dear Matthias Fuchs,
In message 200907161205.00253.matthias.fuchs@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