diff mbox series

[28/36] bdinfo: net: Inline print_eth_ip_addr()

Message ID 20200504231732.98778-20-sjg@chromium.org
State Superseded
Headers show
Series Tidy up the 'bd' command. | expand

Commit Message

Simon Glass May 4, 2020, 11:17 p.m. UTC
This function only has two lines of code now, so inline it.

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

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

Comments

Bin Meng May 6, 2020, 8:10 a.m. UTC | #1
On Tue, May 5, 2020 at 7:19 AM Simon Glass <sjg at chromium.org> wrote:
>
> This function only has two lines of code now, so inline it.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  cmd/bdinfo.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 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 e6237daf93..e30d530411 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -20,7 +20,6 @@  static void print_num(const char *name, ulong value)
 	printf("%-12s= 0x%0*lx\n", name, 2 * (int)sizeof(value), value);
 }
 
-__maybe_unused
 static void print_eth(int idx)
 {
 	char name[10], *val;
@@ -61,14 +60,6 @@  static void print_bi_dram(const bd_t *bd)
 #endif
 }
 
-static void print_eth_ip_addr(void)
-{
-#if defined(CONFIG_CMD_NET)
-	print_eth(0);
-	printf("IP addr     = %s\n", env_get("ipaddr"));
-#endif
-}
-
 void __weak board_detail(void)
 {
 	/* Please define board_detail() for your PPC platform */
@@ -90,13 +81,15 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 	print_num("flashstart", (ulong)bd->bi_flashstart);
 	print_num("flashsize", (ulong)bd->bi_flashsize);
 	print_num("flashoffset", (ulong)bd->bi_flashoffset);
-	print_eth_ip_addr();
 	printf("baudrate    = %u bps\n", gd->baudrate);
 	print_num("relocaddr", gd->relocaddr);
 	print_num("reloc off", gd->reloc_off);
 	printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8);
-	if (IS_ENABLED(CONFIG_CMD_NET))
+	if (IS_ENABLED(CONFIG_CMD_NET)) {
 		printf("current eth = %s\n", eth_get_name());
+		print_eth(0);
+		printf("IP addr     = %s\n", env_get("ipaddr"));
+	}
 	print_num("fdt_blob", (ulong)gd->fdt_blob);
 	print_num("new_fdt", (ulong)gd->new_fdt);
 	print_num("fdt_size", (ulong)gd->fdt_size);