From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bartlomiej Sieka Date: Mon, 14 Apr 2008 14:53:39 +0200 Subject: [U-Boot-Users] [PATCH] Memory footprint optimizations In-Reply-To: <20080409225610.6043224842@gemini.denx.de> References: <20080409225610.6043224842@gemini.denx.de> Message-ID: <480353D3.4090607@semihalf.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.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