diff mbox series

[04/36] bdinfo: xtensa: Create a generic do_bdinfo for xtensa

Message ID 20200504171638.4.I6b06858189c2b3de54feeaab0166c56f33140318@changeid
State Superseded
Headers show
Series Tidy up the 'bd' command. | expand

Commit Message

Simon Glass May 4, 2020, 11:17 p.m. UTC
This arch uses only the generic function. It would be nice if all the
archs did the same. As a first step, create a new generic function for the
'bd' command and make xtensa use it.

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

 cmd/bdinfo.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Bin Meng May 6, 2020, 8:07 a.m. UTC | #1
On Tue, May 5, 2020 at 7:19 AM Simon Glass <sjg at chromium.org> wrote:
>
> This arch uses only the generic function. It would be nice if all the
> archs did the same. As a first step, create a new generic function for the
> 'bd' command and make xtensa use it.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  cmd/bdinfo.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 9edcf8d74e..9247180a29 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -474,14 +474,20 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #elif defined(CONFIG_XTENSA)
 
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+#define USE_GENERIC
+
+#else
+ #error "a case for this architecture does not exist!"
+#endif
+
+/* Temporary check for archs that use generic bdinfo. Eventually all will */
+#ifdef USE_GENERIC
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
 	print_std_bdinfo(gd->bd);
+
 	return 0;
 }
-
-#else
- #error "a case for this architecture does not exist!"
 #endif
 
 /* -------------------------------------------------------------------- */