From: Wolfgang Denk Date: Thu, 09 Sep 2010 20:22:16 +0200 Subject: [U-Boot] [PATCH] [U-BOOT] Zoom2 & Zoom3: introduced a macro to use a different buffer size when compiling for Zoom2 or Zoom3. In-Reply-To: <1283212736-32760-1-git-send-email-aldocedillo@ti.com> References: <1283212736-32760-1-git-send-email-aldocedillo@ti.com> Message-ID: <20100909182216.A40A91506AA@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 Aldo Cedillo, In message <1283212736-32760-1-git-send-email-aldocedillo@ti.com> you wrote: > From: Aldo Brett Cedillo Martinez > > Zoom2 and Zoom2 used to hang with "md" command. It was due to a problem > with a buffer size in print_buffer() function. A macro was introduced > to use a different buffer size in case of compiling for Zoom2 and Zoom3. NAK to this patch. Forst, I thinkt he problem is not with buffer size, but with buffer alignemnt as observed elasewhere, so most probably Albert's "display_buffer: fix misaligned buffer" patch will fix this issue, too. > #define DEFAULT_LINE_LENGTH_BYTES (16) > int print_buffer (ulong addr, void* data, uint width, uint count, uint linelen) > { > +#if defined(CONFIG_OMAP3_ZOOM2) || defined(CONFIG_OMAP3_ZOOM3) > + uint8_t linebuf[DEFAULT_LINE_LENGTH_BYTES]; > +#else > uint8_t linebuf[MAX_LINE_LENGTH_BYTES + 1]; > +#endif /* CONFIG_OMAP3 */ Second, it is broken to use DEFAULT_LINE_LENGTH_BYTES in the declaration of the buffer, but then use MAX_LINE_LENGTH_BYTES+1 when accessing it. [Actually I think we should kill one of these defines.] 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 Overflow on /dev/null, please empty the bit bucket.