
25 Jun
2011
25 Jun
'11
3:05 p.m.
Dear Aneesh V,
In message 4E05CF18.4020800@ti.com you wrote:
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)!
Yes, we should fix the I/O accessors definitons on ARM to provide strict type checking.
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@denx.de
The software required `Windows 95 or better', so I installed Linux.