[U-Boot] [PATCH 2/2 V5] bdinfo: coding style cleanup
Wolfgang Denk
wd at denx.de
Tue Apr 28 00:56:29 CEST 2009
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message <1238927618-15438-2-git-send-email-plagnioj at jcrosoft.com> you wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
...
> #if defined(CONFIG_CMD_NET)
> print_eth(0);
> - printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
> + printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
Please do not insert TABs like here (>>,TAB&<<).
> printf ("baudrate = %d bps\n", bd->bi_baudrate);
> }
> diff --git a/lib_avr32/bdinfo.c b/lib_avr32/bdinfo.c
> index fac5b33..eae4b20 100644
> --- a/lib_avr32/bdinfo.c
> +++ b/lib_avr32/bdinfo.c
> @@ -31,14 +31,14 @@ void arch_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> {
> bd_t *bd = gd->bd;
>
> - print_num ("boot_params", (ulong)bd->bi_boot_params);
> - print_num ("memstart", (ulong)bd->bi_memstart);
> - print_lnum ("memsize", (u64)bd->bi_memsize);
> - print_num ("flashstart", (ulong)bd->bi_flashstart);
> - print_num ("flashsize", (ulong)bd->bi_flashsize);
> - print_num ("flashoffset", (ulong)bd->bi_flashoffset);
> + print_num("boot_params", (ulong)bd->bi_boot_params);
> + print_num("memstart", (ulong)bd->bi_memstart);
> + print_lnum("memsize", (u64)bd->bi_memsize);
> + print_num("flashstart", (ulong)bd->bi_flashstart);
> + print_num("flashsize", (ulong)bd->bi_flashsize);
> + print_num("flashoffset", (ulong)bd->bi_flashoffset);
If your intention was to make the code more readable, you might even
consider vertial alignment, for example like this:
+ print_num ("boot_params", (ulong)bd->bi_boot_params);
+ print_num ("memstart", (ulong)bd->bi_memstart);
+ print_lnum("memsize", (u64)bd->bi_memsize);
+ print_num ("flashstart", (ulong)bd->bi_flashstart);
+ print_num ("flashsize", (ulong)bd->bi_flashsize);
+ print_num ("flashoffset", (ulong)bd->bi_flashoffset);
Looks *much* niver IMO. Ditto elsewhere.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Children are natural mimics who act like their parents despite every
effort to teach them good manners.
More information about the U-Boot
mailing list