[U-Boot] [PATCH V4 04/11] imximage: prepare to move static variables to struct data_src
Wolfgang Denk
wd at denx.de
Wed Nov 28 21:30:40 CET 2012
Dear Troy Kisky,
In message <50B659AD.9090704 at boundarydevices.com> you wrote:
>
> > Could you please elucidate why exactly this is _needed_?
>
> My goal was to reduce the number of static variables, but strictly speaking
> it has little benefit other than giving me a warm fuzzy feeling.
>
> I'm not that only one that dislikes static though.
...
> ds is on the stack, and even if not needed now, I like to avoid future
> random bugs.
Did you check the impact of your changes on the memory footprint?
Changing code that uses a static variable initialized (implicitly or
explicitly) to zero [which results in allocation of the BSS segment,
i. e. zero space in the code or in the image file] into real code
is something that is a bit of expensive just for satisfying random
"dislikes".
I think you should better leave that as is. The code is pretty
efficent that way, and you increase it for little or no benefit.
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 nice thing about standards is that there are so many to choose
from. - Andrew S. Tanenbaum
More information about the U-Boot
mailing list