diff mbox

[U-Boot,05/16] board_f: Use a single condition for reserve_logbuffer()

Message ID 20170331144039.14587-6-sjg@chromium.org
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass March 31, 2017, 2:40 p.m. UTC
CONFIG_ALT_LB_ADDR is really a detail of how this logbuffer is allocated
rather than whether to do it at all. So move the #ifdef into the function.

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

 common/board_f.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Tom Rini April 6, 2017, 4:25 p.m. UTC | #1
On Fri, Mar 31, 2017 at 08:40:28AM -0600, Simon Glass wrote:

> CONFIG_ALT_LB_ADDR is really a detail of how this logbuffer is allocated
> rather than whether to do it at all. So move the #ifdef into the function.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

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

Patch

diff --git a/common/board_f.c b/common/board_f.c
index 0b0b01543e..c7b5e0af9e 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -345,13 +345,16 @@  static int reserve_prom(void)
 }
 #endif
 
-#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR)
+#if defined(CONFIG_LOGBUFFER)
 static int reserve_logbuffer(void)
 {
+#ifndef CONFIG_ALT_LB_ADDR
 	/* reserve kernel log buffer */
 	gd->relocaddr -= LOGBUFF_RESERVE;
 	debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN,
 		gd->relocaddr);
+#endif
+
 	return 0;
 }
 #endif
@@ -894,7 +897,7 @@  static const init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_SPARC)
 	reserve_prom,
 #endif
-#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR)
+#if defined(CONFIG_LOGBUFFER)
 	reserve_logbuffer,
 #endif
 #ifdef CONFIG_PRAM