From: Wolfgang Denk Date: Tue, 04 Jun 2013 17:05:58 +0200 Subject: [U-Boot] [PATCH V3] lcd: align bmp header when uncopmressing image In-Reply-To: <1370343625-16596-1-git-send-email-p.wilczek@samsung.com> References: <1370267979-17800-1-git-send-email-p.wilczek@samsung.com> <1370343625-16596-1-git-send-email-p.wilczek@samsung.com> Message-ID: <20130604150558.DB8C738306D@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 Piotr Wilczek, In message <1370343625-16596-1-git-send-email-p.wilczek@samsung.com> you wrote: > When compressed image is loaded, it must be decompressed > to an aligned address + 2 to avoid unaligned access exception > on some ARM platforms. ... > + /* align to 32-bit-aligned-address + 2 */ > + if ((unsigned int)bmp % 4 != 2) > + bmp = (bmp_image_t *)((((unsigned int)dst + 1) & ~3) + 2); Please drop the "if()" - it is not necessary and just adds to the code size. 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 Never underestimate the bandwidth of a station wagon full of tapes. -- Dr. Warren Jackson, Director, UTCS