diff mbox

[U-Boot,1/7] spl: spl_relocate_stack_gd: Do not unnecessarily clear bss

Message ID 1442158965-29962-2-git-send-email-hdegoede@redhat.com
State Accepted
Delegated to: Hans de Goede
Headers show

Commit Message

Hans de Goede Sept. 13, 2015, 3:42 p.m. UTC
spl_relocate_stack_gd only gets called from arch/arm/lib/crt0.S which
clears the bss directly after calling it, so there is no need to clear
it from spl_relocate_stack_gd.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 common/spl/spl.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Simon Glass Sept. 22, 2015, 4 a.m. UTC | #1
Hi Hans,

On 13 September 2015 at 09:42, Hans de Goede <hdegoede@redhat.com> wrote:
>
> spl_relocate_stack_gd only gets called from arch/arm/lib/crt0.S which
> clears the bss directly after calling it, so there is no need to clear
> it from spl_relocate_stack_gd.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  common/spl/spl.c | 3 ---
>  1 file changed, 3 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

I think it makes sense to move the BSS clear to C, but that would be
separate from your patch. Yes we should remove this duplication.

See also this:

http://patchwork.ozlabs.org/patch/512030/

>
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index a5892d7..b09a626 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -347,9 +347,6 @@ ulong spl_relocate_stack_gd(void)
>         memcpy(new_gd, (void *)gd, sizeof(gd_t));
>         gd = new_gd;
>
> -       /* Clear the BSS. */
> -       memset(__bss_start, 0, __bss_end - __bss_start);
> -
>         return ptr;
>  #else
>         return 0;
> --
> 2.4.3
>

Regards,
Simon
diff mbox

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index a5892d7..b09a626 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -347,9 +347,6 @@  ulong spl_relocate_stack_gd(void)
 	memcpy(new_gd, (void *)gd, sizeof(gd_t));
 	gd = new_gd;
 
-	/* Clear the BSS. */
-	memset(__bss_start, 0, __bss_end - __bss_start);
-
 	return ptr;
 #else
 	return 0;