[27/36] bdinfo: net: Inline print_eths()

Message ID 20200504231732.98778-19-sjg@chromium.org
State New
Headers show
Series
  • Tidy up the 'bd' command.
Related show

Commit Message

Simon Glass May 4, 2020, 11:17 p.m.
This function has only one line of code so inline it.

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

 cmd/bdinfo.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Bin Meng May 6, 2020, 8:10 a.m. | #1
Hi Simon,

On Tue, May 5, 2020 at 7:19 AM Simon Glass <sjg at chromium.org> wrote:
>
> This function has only one line of code so inline it.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  cmd/bdinfo.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
> index ba69575fc2..e6237daf93 100644
> --- a/cmd/bdinfo.c
> +++ b/cmd/bdinfo.c
> @@ -34,11 +34,6 @@ static void print_eth(int idx)
>         printf("%-12s= %s\n", name, val);
>  }
>
> -static void print_eths(void)
> -{
> -       printf("current eth = %s\n", eth_get_name());
> -}
> -
>  static void print_lnum(const char *name, unsigned long long value)
>  {
>         printf("%-12s= 0x%.8llX\n", name, value);
> @@ -101,7 +96,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
>         print_num("reloc off", gd->reloc_off);
>         printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8);
>         if (IS_ENABLED(CONFIG_CMD_NET))
> -               print_eths();
> +               printf("current eth = %s\n", eth_get_name());
>         print_num("fdt_blob", (ulong)gd->fdt_blob);
>         print_num("new_fdt", (ulong)gd->new_fdt);
>         print_num("fdt_size", (ulong)gd->fdt_size);
> --

I think this patch should be squashed into [26/36] bdinfo: net: Drop
legacy ethernet bdinfo

Regards,
Bin

Patch

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index ba69575fc2..e6237daf93 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -34,11 +34,6 @@  static void print_eth(int idx)
 	printf("%-12s= %s\n", name, val);
 }
 
-static void print_eths(void)
-{
-	printf("current eth = %s\n", eth_get_name());
-}
-
 static void print_lnum(const char *name, unsigned long long value)
 {
 	printf("%-12s= 0x%.8llX\n", name, value);
@@ -101,7 +96,7 @@  int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 	print_num("reloc off", gd->reloc_off);
 	printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8);
 	if (IS_ENABLED(CONFIG_CMD_NET))
-		print_eths();
+		printf("current eth = %s\n", eth_get_name());
 	print_num("fdt_blob", (ulong)gd->fdt_blob);
 	print_num("new_fdt", (ulong)gd->new_fdt);
 	print_num("fdt_size", (ulong)gd->fdt_size);