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

Wolfgang Denk wd at denx.de
Thu Apr 16 06:25:34 CEST 2015


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.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
Command, n.:
            Statement presented by a human and accepted by a computer
in such a manner as to make the human feel as if he is in control.


More information about the U-Boot mailing list