From: Wolfgang Denk Date: Mon, 09 Aug 2010 00:28:51 +0200 Subject: [U-Boot] [PATCH] print_buffer: optimize & shrink In-Reply-To: <1279880250-2226-1-git-send-email-vapier@gentoo.org> References: <1279880250-2226-1-git-send-email-vapier@gentoo.org> Message-ID: <20100808222852.160991536EF@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 Mike Frysinger, In message <1279880250-2226-1-git-send-email-vapier@gentoo.org> you wrote: > Applying a little creative format string allows us to shrink the initial > data read & display loop by only calling printf once. Re-using the local > data buffer to generate the string we want to display then allows us to > output everything with just one printf call instead of multiple calls to > the putc function. > > The local stack buffer needs increasing by 1 byte, but the resulting code > shrink and speed up is worth it I think. > > Signed-off-by: Mike Frysinger > --- > lib/display_options.c | 27 +++++++++++++-------------- > 1 files changed, 13 insertions(+), 14 deletions(-) Applied, thanks. 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 "The number of Unix installations has grown to 10, with more expected." - The Unix Programmer's Manual, 2nd Edition, June, 1972