diff mbox

[U-Boot,V2,2/2] malloc: remove !gd handling

Message ID 1457199053-23395-2-git-send-email-swarren@wwwdotorg.org
State Accepted
Commit deff6fb3a7790e93264292982000275e78bb12e5
Delegated to: Tom Rini
Headers show

Commit Message

Stephen Warren March 5, 2016, 5:30 p.m. UTC
Following the previous patch, malloc() is never called before gd is set,
so we can remove the special-case check for this condition.

This reverts commit 854d2b9753e4 "dlmalloc: ensure gd is set for early
alloc".

Cc: Rabin Vincent <rabin@rab.in>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 common/dlmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini March 5, 2016, 5:45 p.m. UTC | #1
On Sat, Mar 05, 2016 at 10:30:53AM -0700, Stephen Warren wrote:

> Following the previous patch, malloc() is never called before gd is set,
> so we can remove the special-case check for this condition.
> 
> This reverts commit 854d2b9753e4 "dlmalloc: ensure gd is set for early
> alloc".
> 
> Cc: Rabin Vincent <rabin@rab.in>
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass March 7, 2016, 2:39 a.m. UTC | #2
On 5 March 2016 at 10:30, Stephen Warren <swarren@wwwdotorg.org> wrote:
> Following the previous patch, malloc() is never called before gd is set,
> so we can remove the special-case check for this condition.
>
> This reverts commit 854d2b9753e4 "dlmalloc: ensure gd is set for early
> alloc".
>
> Cc: Rabin Vincent <rabin@rab.in>
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
> ---
>  common/dlmalloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini March 8, 2016, 11:42 p.m. UTC | #3
On Sat, Mar 05, 2016 at 10:30:53AM -0700, Stephen Warren wrote:

> Following the previous patch, malloc() is never called before gd is set,
> so we can remove the special-case check for this condition.
> 
> This reverts commit 854d2b9753e4 "dlmalloc: ensure gd is set for early
> alloc".
> 
> Cc: Rabin Vincent <rabin@rab.in>
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 5ea37dfb6e4c..d66e80c647ce 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -2184,7 +2184,7 @@  Void_t* mALLOc(bytes) size_t bytes;
   INTERNAL_SIZE_T nb;
 
 #ifdef CONFIG_SYS_MALLOC_F_LEN
-	if (gd && !(gd->flags & GD_FLG_FULL_MALLOC_INIT))
+	if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT))
 		return malloc_simple(bytes);
 #endif