[U-Boot] [PATCH] print_buffer: optimize & shrink

Wolfgang Denk wd at denx.de
Mon Aug 9 00:28:51 CEST 2010


Dear Mike Frysinger,

In message <1279880250-2226-1-git-send-email-vapier at 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 <vapier at gentoo.org>
> ---
>  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


More information about the U-Boot mailing list