summaryrefslogtreecommitdiff
path: root/common/init
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-01-12 13:16:03 -0500
committerTom Rini <trini@konsulko.com>2017-01-20 15:38:01 -0500
commitc67c8c604b6cea341055140cbfa9e6949fcacb7f (patch)
tree3bb2b125688468612082dbab6eccd15ac56d7cd2 /common/init
parent40d5534cff720d566cd52f532f26eea2bd86c1ae (diff)
board_init.c: Always use memset()
We can make the code read more easily here by simply using memset() always as when we don't have an optimized version of the function we will still have a version of this function around anyhow. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/init')
-rw-r--r--common/init/board_init.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/common/init/board_init.c b/common/init/board_init.c
index 193d8180a9..bf4255b4ae 100644
--- a/common/init/board_init.c
+++ b/common/init/board_init.c
@@ -11,16 +11,6 @@
DECLARE_GLOBAL_DATA_PTR;
-/*
- * It isn't trivial to figure out whether memcpy() exists. The arch-specific
- * memcpy() is not normally available in SPL due to code size.
- */
-#if !defined(CONFIG_SPL_BUILD) || \
- (defined(CONFIG_SPL_LIBGENERIC_SUPPORT) && \
- !defined(CONFIG_SPL_USE_ARCH_MEMCPY))
-#define _USE_MEMCPY
-#endif
-
/* Unfortunately x86 or ARM can't compile this code as gd cannot be assigned */
#if !defined(CONFIG_X86) && !defined(CONFIG_ARM)
__weak void arch_setup_gd(struct global_data *gd_ptr)
@@ -110,9 +100,6 @@ ulong board_init_f_alloc_reserve(ulong top)
void board_init_f_init_reserve(ulong base)
{
struct global_data *gd_ptr;
-#ifndef _USE_MEMCPY
- int *ptr;
-#endif
/*
* clear GD entirely and set it up.
@@ -121,12 +108,7 @@ void board_init_f_init_reserve(ulong base)
gd_ptr = (struct global_data *)base;
/* zero the area */
-#ifdef _USE_MEMCPY
memset(gd_ptr, '\0', sizeof(*gd));
-#else
- for (ptr = (int *)gd_ptr; ptr < (int *)(gd_ptr + 1); )
- *ptr++ = 0;
-#endif
/* set GD unless architecture did it already */
#if !defined(CONFIG_ARM)
arch_setup_gd(gd_ptr);