All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 1/3] malloc_simple: Add debug statements to memalign_simple
Date: Fri, 27 Jan 2017 10:39:18 -0600	[thread overview]
Message-ID: <20170127163920.31607-2-afd@ti.com> (raw)
In-Reply-To: <20170127163920.31607-1-afd@ti.com>

Add debug statements to memalign_simple to match malloc_simple.

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 common/malloc_simple.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/malloc_simple.c b/common/malloc_simple.c
index 0f6bcbcc71..611400265b 100644
--- a/common/malloc_simple.c
+++ b/common/malloc_simple.c
@@ -39,10 +39,14 @@ void *memalign_simple(size_t align, size_t bytes)
 
 	addr = ALIGN(gd->malloc_base + gd->malloc_ptr, align);
 	new_ptr = addr + bytes - gd->malloc_base;
-	if (new_ptr > gd->malloc_limit)
+	if (new_ptr > gd->malloc_limit) {
+		debug("space exhausted\n");
 		return NULL;
+	}
+
 	ptr = map_sysmem(addr, bytes);
 	gd->malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
+	debug("%lx\n", (ulong)ptr);
 
 	return ptr;
 }
-- 
2.11.0

  reply	other threads:[~2017-01-27 16:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 16:39 [U-Boot] [PATCH v4 0/3] Add a config for AM335x High Security EVM Andrew F. Davis
2017-01-27 16:39 ` Andrew F. Davis [this message]
2017-01-27 16:43   ` [U-Boot] [PATCH v4 1/3] malloc_simple: Add debug statements to memalign_simple Tom Rini
2017-01-28 22:46   ` [U-Boot] [U-Boot, v4, " Tom Rini
2017-01-27 16:39 ` [U-Boot] [PATCH v4 2/3] spl: Remove overwrite of relocated malloc limit Andrew F. Davis
2017-01-27 16:43   ` Tom Rini
2017-01-28 22:46   ` [U-Boot] [U-Boot, v4, " Tom Rini
2017-02-01 23:48   ` [U-Boot] [PATCH v4 " André Przywara
2017-02-02  0:08     ` Tom Rini
2017-02-02  0:17       ` André Przywara
2017-02-02  5:35     ` Lokesh Vutla
2017-02-02 10:18       ` Andre Przywara
2017-01-27 16:39 ` [U-Boot] [PATCH v4 3/3] defconfig: Add a config for AM335x High Security EVM Andrew F. Davis
2017-01-28 22:46   ` [U-Boot] [U-Boot, v4, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170127163920.31607-2-afd@ti.com \
    --to=afd@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.