From: Wolfgang Denk Date: Wed, 08 Sep 2010 01:22:16 +0200 Subject: [U-Boot] [PATCH] display_buffer: fix misaligned buffer In-Reply-To: <4C7B7864.2080607@emk-elektronik.de> References: <1282940584-27957-1-git-send-email-u-boot@emk-elektronik.de> <4C7B7864.2080607@emk-elektronik.de> Message-ID: <20100907232216.2E8C1153798@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Reinhard Meyer, In message <4C7B7864.2080607@emk-elektronik.de> you wrote: > > One could add a comment above like: > /* > * it is mandatory that linebuf stays uint32_t aligned > * since we are going to slide along it with a uint32_t > * pointer > */ > uint32_t linebuf[MAX_LINE_LENGTH_BYTES/4 + 1]; ...and using the attribute avoids the ugly code and all the 5 lines of comment because it's self-explanatory. > I personally prefer this above an attribute. Its disputeable but I prefer > to do things with "normal C constructs" where possible. You can already > see from the discussion that __aligned as a toolchain-abstracted > variant (defined in a toolchain header file) or attribute((__aligned__)) > as a very toolchain dependant variant shall be used ;) > > Anyway, both patches have been offered, any will work for me as long as > I can see ASCII properly on ARM machines... Please let's use the attribute version. 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 "355/113 -- Not the famous irrational number PI, but an incredible simulation!"