[U-Boot-Users] [PATCH] Memory footprint optimizations
Bartlomiej Sieka
tur at semihalf.com
Mon Apr 14 14:53:39 CEST 2008
Wolfgang Denk wrote:
> In message <20080409213733.5006.37998.stgit at 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
More information about the U-Boot
mailing list