From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Sat, 25 Jun 2011 17:35:44 +0530 Subject: [U-Boot] [PATCH v2 13/22] omap4: add clock support In-Reply-To: <20110517214432.F3D9F1491B0A@gemini.denx.de> References: <1298893591-17636-1-git-send-email-aneesh@ti.com> <1305472900-4004-14-git-send-email-aneesh@ti.com> <20110515190029.7179C1491B06@gemini.denx.de> <4DD27893.5000606@ti.com> <20110517214432.F3D9F1491B0A@gemini.denx.de> Message-ID: <4E05CF18.4020800@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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