[U-Boot] [PATCH V4 04/11] imximage: prepare to move static variables to struct data_src

Troy Kisky troy.kisky at boundarydevices.com
Wed Nov 28 19:36:29 CET 2012


On 11/28/2012 2:38 AM, Wolfgang Denk wrote:
> Dear Troy Kisky,
>
> In message <1354066303-29762-5-git-send-email-troy.kisky at boundarydevices.com> you wrote:
>> Need to move accesses to the static variables to
>> a function where struct data_src is used.
> 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.

>
>> +	/* Be able to detect if the cfg file has no BOOT_FROM tag */
>> +	g_flash_offset = FLASH_OFFSET_UNDEFINED;
>> +	memset(&ds, 0, sizeof(struct data_src));
> Is this initialization really needed?
>
> Best regards,
>
> Wolfgang Denk
>
ds is on the stack, and even if not needed now, I like to avoid future 
random bugs.

Troy



More information about the U-Boot mailing list