Dear Wolfgang, On Wednesday 18 May 2011 03:14 AM, Wolfgang Denk wrote: > Dear Aneesh V, > [snip ...] >>> NAK. We do not accept base address plus offset notation. Please >>> declare C structs instead. >>> >> >> Ok. will do. >> >> Again just curious, what's the reasoning behind this policy? Is it just >> aesthetics or something more? > > It's more. When using base+offset, the compiler will know nothing > about the data type, so it canot warn you if you use a 32 bit accessor > on a 8 bit register, or vice versa. When you pass a struct element, > it can check type information.
Is this really valid in our context? readl()/writel() and friends just cast the address to the target type pointer. I tried writeb() on my 32 bit register represented using the struct approach and the compiler didn't give any warning (as expected)! best regards, Aneesh _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot