Message ID | 20200504231732.98778-12-sjg@chromium.org |
---|---|
State | Superseded |
Headers | show |
Series | Tidy up the 'bd' command. | expand |
On Tue, May 5, 2020 at 7:19 AM Simon Glass <sjg at chromium.org> wrote: > > It isn't worth having arch-specific code for such minor output > differences. In fact it is better if all archs are consistent. > > Drop the arch-specific code in print_bi_mem() and inline it to avoid a > two-line function. > > Signed-off-by: Simon Glass <sjg at chromium.org> > --- > > cmd/bdinfo.c | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) > Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
Hi Simon, > Subject: Re: [PATCH 20/36] bdinfo: sh: arc: Drop arch-specific print_bi_mem() > > On Tue, May 5, 2020 at 7:19 AM Simon Glass <sjg at chromium.org> wrote: > > > > It isn't worth having arch-specific code for such minor output > > differences. In fact it is better if all archs are consistent. > > > > Drop the arch-specific code in print_bi_mem() and inline it to avoid a > > two-line function. > > > > Signed-off-by: Simon Glass <sjg at chromium.org> > > --- > > > > cmd/bdinfo.c | 17 ++--------------- > > 1 file changed, 2 insertions(+), 15 deletions(-) I guess this entire series is available in the following tree, right? https://gitlab.denx.de/u-boot/custodians/u-boot-dm/-/tree/bd-working In that case I'm very happy with that change as well as removal of the duplicated spaghetti-code - thanks for taking care of that! Acked-by: Alexey Brodkin <abrodkin at synopsys.com>
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index 62eea010c5..5ffd86e508 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -78,20 +78,6 @@ static void print_bi_boot_params(const bd_t *bd) print_num("boot_params", (ulong)bd->bi_boot_params); } -static void print_bi_mem(const bd_t *bd) -{ -#if defined(CONFIG_SH) - print_num("mem start ", (ulong)bd->bi_memstart); - print_lnum("mem size ", (u64)bd->bi_memsize); -#elif defined(CONFIG_ARC) - print_num("mem start", (ulong)bd->bi_memstart); - print_lnum("mem size", (u64)bd->bi_memsize); -#else - print_num("memstart", (ulong)bd->bi_memstart); - print_lnum("memsize", (u64)bd->bi_memsize); -#endif -} - static void print_bi_dram(const bd_t *bd) { #ifdef CONFIG_NR_DRAM_BANKS @@ -153,7 +139,8 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) print_num("arch_number", bd->bi_arch_number); print_bi_boot_params(bd); print_bi_dram(bd); - print_bi_mem(bd); + print_num("memstart", (ulong)bd->bi_memstart); + print_lnum("memsize", (u64)bd->bi_memsize); print_bi_flash(bd); print_eth_ip_addr(); printf("baudrate = %u bps\n", gd->baudrate);
It isn't worth having arch-specific code for such minor output differences. In fact it is better if all archs are consistent. Drop the arch-specific code in print_bi_mem() and inline it to avoid a two-line function. Signed-off-by: Simon Glass <sjg at chromium.org> --- cmd/bdinfo.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)