[U-Boot] [PATCH 02/10] board_init_f_mem(): Don't require memset()

Simon Glass sjg at chromium.org
Sun Apr 19 16:22:29 CEST 2015


Hi Wolfgang,

On 15 April 2015 at 22:25, Wolfgang Denk <wd at denx.de> wrote:
> Dear Simon Glass,
>
> In message <1429146849-11994-3-git-send-email-sjg at chromium.org> you wrote:
>> Unfortunately memset() is not always available, so provide a substitute when
>> needed.
>
>> +#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBGENERIC_SUPPORT)
>>       memset((void *)gd, '\0', sizeof(*gd));
>> +#else
>> +     int *ptr = (int *)gd;
>> +     int *end = (int *)(gd + 1);
>> +
>> +     while (ptr < end)
>> +             *ptr++ = 0;
>> +#endif
>
> Please don't declare variables in the middle of the code.

OK I'll tidy that up.

Regards,
Simon


More information about the U-Boot mailing list