From: Wolfgang Denk Date: Wed, 08 Sep 2010 09:48:57 +0200 Subject: [U-Boot] [PATCH v2] display_buffer: fix misaligned buffer In-Reply-To: <4C87065A.5050904@emk-elektronik.de> References: <1283243000-25427-1-git-send-email-u-boot@emk-elektronik.de> <20100907233338.CE0A31506AA@gemini.denx.de> <4C87065A.5050904@emk-elektronik.de> Message-ID: <20100908074857.B81BF153798@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 <4C87065A.5050904@emk-elektronik.de> you wrote: > Dear Wolfgang Denk, > >> + /* linebuf as a union causes proper alignment */ > >> + union linebuf { > >> + uint32_t ui[MAX_LINE_LENGTH_BYTES/4 + 1]; > >> + uint16_t us[MAX_LINE_LENGTH_BYTES/2 + 1]; > >> + uint8_t uc[MAX_LINE_LENGTH_BYTES/1 + 1]; > > > > Please replace the magic numbers 4, 2 and 1 by respective sizeof(). > > > AND > > > > Please let's use the attribute version. > > Which shall it be now??? Well, my personal preference would be to use "attribute", but after the long discussion it seems the general preference is the version above so I will not block this. I just ask to change the "magic numbers" 1, 2 and 4 into sizeof() so it's obvious where these are coming from. 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 Hello! I'm from outer space, and I've made myself look like a signa- ture. While you are reading this, I'm having sex with your eyes. I know it feels good to you, because you're smiling. I'm very horny, so send me to someone else when you've had enough. Thanks! Sincerely, A Stranger in a Strange Land