public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bartlomiej Sieka <tur@semihalf.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Memory footprint optimizations
Date: Mon, 14 Apr 2008 14:53:39 +0200	[thread overview]
Message-ID: <480353D3.4090607@semihalf.com> (raw)
In-Reply-To: <20080409225610.6043224842@gemini.denx.de>

Wolfgang Denk wrote:
> In message <20080409213733.5006.37998.stgit@pollux.denx.de> you wrote:
>> As suggested by Wolfgang Denk:
>> - remove wrappers for image printing function
>> - merge getenv_verify and getenv_autostart into one parametrized function
> ...
>> -	image_print_contents (hdr);
>> +	image_print_contents (hdr, "   ");
> 
> Now we have some 20+ calls of
> 
> 	image_print_contents (hdr, "   ");
> 
> plus two calls of
> 
> 	image_print_contents (hdr, "");
> 
> Maybe there is some clever way to get rid of this second argument?

We could use the following two facts:
1. the image contents are printed with only two indentations: 0 or 3 spaces,
2. indentation with 3 spaces is used in U-Boot, indentation with 0
spaces is used in mkimage.

With the following change we could then drop the second argument altogether:

--- a/common/image.c
+++ b/common/image.c
@@ -301,8 +301,16 @@ static void image_print_type (image_header_t *hdr)
   * returns:
   *     no returned results
   */
-void image_print_contents (image_header_t *hdr, const char *p)
+void image_print_contents (image_header_t *hdr)
  {
+       const char *p;
+
+#ifdef USE_HOSTCC
+       p = "";
+#else
+       p = "   ";
+#endif
+


If the above is what is wanted, I'll prepare a patch -- comments are
welcome.

Regards,
Bartlomiej

  reply	other threads:[~2008-04-14 12:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09 21:37 [U-Boot-Users] [PATCH] Memory footprint optimizations Bartlomiej Sieka
2008-04-09 22:56 ` Wolfgang Denk
2008-04-14 12:53   ` Bartlomiej Sieka [this message]
2008-04-14 19:50     ` Wolfgang Denk
2008-04-18 10:39       ` [U-Boot-Users] [PATCH v2] " Bartlomiej Sieka
2008-04-24 15:23         ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=480353D3.4090607@semihalf.com \
    --to=tur@semihalf.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox