diff mbox

[U-Boot] CONFIG_NEEDS_MANUAL_RELOC: Fix warnings when not set

Message ID 1449495315-23144-1-git-send-email-trini@konsulko.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Tom Rini Dec. 7, 2015, 1:35 p.m. UTC
Now that we may compile (but not link) code calling fixup_cmdtable when
this is not set, we need to always have the declaration available.  We
should also make sure that anyone calling the function includes
<command.h> as that's where the function declaration is.

Signed-off-by: Tom Rini <trini@konsulko.com>

---
Changes in v2:
- Move declaration up to be under the current __ASSEMBLY__ test.
---
 common/board_r.c  |    1 +
 include/command.h |    5 +----
 test/dm/cmd_dm.c  |    1 +
 3 files changed, 3 insertions(+), 4 deletions(-)

Comments

Tom Rini Dec. 7, 2015, 7:06 p.m. UTC | #1
On Mon, Dec 07, 2015 at 08:35:15AM -0500, Tom Rini wrote:

> Now that we may compile (but not link) code calling fixup_cmdtable when
> this is not set, we need to always have the declaration available.  We
> should also make sure that anyone calling the function includes
> <command.h> as that's where the function declaration is.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> 

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

Patch

diff --git a/common/board_r.c b/common/board_r.c
index 5af32dd..75ee43e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -15,6 +15,7 @@ 
 #if defined(CONFIG_CMD_BEDBUG)
 #include <bedbug/type.h>
 #endif
+#include <command.h>
 #include <console.h>
 #ifdef CONFIG_HAS_DATAFLASH
 #include <dataflash.h>
diff --git a/include/command.h b/include/command.h
index 6c04cd9..2ae9b6c 100644
--- a/include/command.h
+++ b/include/command.h
@@ -142,6 +142,7 @@  enum command_ret_t {
 int cmd_process(int flag, int argc, char * const argv[],
 			       int *repeatable, unsigned long *ticks);
 
+void fixup_cmdtable(cmd_tbl_t *cmdtp, int size);
 #endif	/* __ASSEMBLY__ */
 
 /*
@@ -179,8 +180,4 @@  int cmd_process(int flag, int argc, char * const argv[],
 #define U_BOOT_CMD(_name, _maxargs, _rep, _cmd, _usage, _help)		\
 	U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, _help, NULL)
 
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
-void fixup_cmdtable(cmd_tbl_t *cmdtp, int size);
-#endif
-
 #endif	/* __COMMAND_H */
diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index b6e7109..a3c5971 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -8,6 +8,7 @@ 
  */
 
 #include <common.h>
+#include <command.h>
 #include <dm.h>
 #include <malloc.h>
 #include <mapmem.h>