[U-Boot] [PATCH] cmd_mem.c: Fix help message alignment

Bug was introced by "Big white-space cleanup" (53677ef1)
Signed-off-by: Wolfgang Denk wd@denx.de --- common/cmd_mem.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/common/cmd_mem.c b/common/cmd_mem.c index a78355c..4766c24 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -1230,39 +1230,39 @@ int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #if defined(CONFIG_CMD_MEMORY) U_BOOT_CMD( md, 3, 1, do_mem_md, - "md - memory display\n", + "md - memory display\n", "[.b, .w, .l] address [# of objects]\n - memory display\n" );
U_BOOT_CMD( mm, 2, 1, do_mem_mm, - "mm - memory modify (auto-incrementing)\n", + "mm - memory modify (auto-incrementing)\n", "[.b, .w, .l] address\n" " - memory modify, auto increment address\n" );
U_BOOT_CMD( nm, 2, 1, do_mem_nm, - "nm - memory modify (constant address)\n", + "nm - memory modify (constant address)\n", "[.b, .w, .l] address\n - memory modify, read and keep address\n" );
U_BOOT_CMD( mw, 4, 1, do_mem_mw, - "mw - memory write (fill)\n", - "[.b, .w, .l] address value [count]\n - write memory\n" + "mw - memory write (fill)\n", + "[.b, .w, .l] address value [count]\n - write memory\n" );
U_BOOT_CMD( cp, 4, 1, do_mem_cp, - "cp - memory copy\n", + "cp - memory copy\n", "[.b, .w, .l] source target count\n - copy memory\n" );
U_BOOT_CMD( cmp, 4, 1, do_mem_cmp, - "cmp - memory compare\n", + "cmp - memory compare\n", "[.b, .w, .l] addr1 addr2 count\n - compare memory\n" );
@@ -1270,7 +1270,7 @@ U_BOOT_CMD(
U_BOOT_CMD( crc32, 4, 1, do_mem_crc, - "crc32 - checksum calculation\n", + "crc32 - checksum calculation\n", "address count [addr]\n - compute CRC32 checksum [save at addr]\n" );
@@ -1278,7 +1278,7 @@ U_BOOT_CMD(
U_BOOT_CMD( crc32, 5, 1, do_mem_crc, - "crc32 - checksum calculation\n", + "crc32 - checksum calculation\n", "address count [addr]\n - compute CRC32 checksum [save at addr]\n" "-v address count crc\n - verify crc of memory area\n" ); @@ -1287,14 +1287,14 @@ U_BOOT_CMD(
U_BOOT_CMD( base, 2, 1, do_mem_base, - "base - print or set address offset\n", + "base - print or set address offset\n", "\n - print address offset for memory commands\n" "base off\n - set address offset for memory commands to 'off'\n" );
U_BOOT_CMD( loop, 3, 1, do_mem_loop, - "loop - infinite loop on address range\n", + "loop - infinite loop on address range\n", "[.b, .w, .l] address number_of_objects\n" " - loop on a set of addresses\n" ); @@ -1302,7 +1302,7 @@ U_BOOT_CMD( #ifdef CONFIG_LOOPW U_BOOT_CMD( loopw, 4, 1, do_mem_loopw, - "loopw - infinite write loop on address range\n", + "loopw - infinite write loop on address range\n", "[.b, .w, .l] address number_of_objects data_to_write\n" " - loop on a set of addresses\n" ); @@ -1310,7 +1310,7 @@ U_BOOT_CMD(
U_BOOT_CMD( mtest, 4, 1, do_mem_mtest, - "mtest - simple RAM test\n", + "mtest - simple RAM test\n", "[start [end [pattern]]]\n" " - simple RAM read/write test\n" ); @@ -1318,13 +1318,13 @@ U_BOOT_CMD( #ifdef CONFIG_MX_CYCLIC U_BOOT_CMD( mdc, 4, 1, do_mem_mdc, - "mdc - memory display cyclic\n", + "mdc - memory display cyclic\n", "[.b, .w, .l] address count delay(ms)\n - memory display cyclic\n" );
U_BOOT_CMD( mwc, 4, 1, do_mem_mwc, - "mwc - memory write cyclic\n", + "mwc - memory write cyclic\n", "[.b, .w, .l] address value delay(ms)\n - memory write cyclic\n" ); #endif /* CONFIG_MX_CYCLIC */

Use the same mapping in flash as used by Linux
Signed-off-by: Wolfgang Denk wd@denx.de --- include/configs/ads5121.h | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/configs/ads5121.h b/include/configs/ads5121.h index d129ea3..5f74afb 100644 --- a/include/configs/ads5121.h +++ b/include/configs/ads5121.h @@ -435,16 +435,18 @@
#define CONFIG_EXTRA_ENV_SETTINGS \ "u-boot_addr_r=200000\0" \ - "kernel_addr_r=300000\0" \ - "fdt_addr_r=400000\0" \ - "ramdisk_addr_r=500000\0" \ + "kernel_addr_r=600000\0" \ + "fdt_addr_r=880000\0" \ + "ramdisk_addr_r=900000\0" \ "u-boot_addr=FFF00000\0" \ - "kernel_addr=FC040000\0" \ - "fdt_addr=FC2C0000\0" \ - "ramdisk_addr=FC300000\0" \ + "kernel_addr=FFC40000\0" \ + "fdt_addr=FFEC0000\0" \ + "ramdisk_addr=FC040000\0" \ "ramdiskfile=ads5121/uRamdisk\0" \ - "fdtfile=ads5121/ads5121.dtb\0" \ "u-boot=ads5121/u-boot.bin\0" \ + "bootfile=ads5121/uImage\0" \ + "fdtfile=ads5121/ads5121.dtb\0" \ + "rootpath=/opt/eldk/ppc_6xx\n" \ "netdev=eth0\0" \ "consdev=ttyPSC0\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \

On Tue, 2008-08-26 at 15:03 +0200, Wolfgang Denk wrote:
Bug was introced by "Big white-space cleanup" (53677ef1)
s/introced/introduced/
Signed-off-by: Wolfgang Denk wd@denx.de
common/cmd_mem.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/common/cmd_mem.c b/common/cmd_mem.c index a78355c..4766c24 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -1230,39 +1230,39 @@ int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #if defined(CONFIG_CMD_MEMORY) U_BOOT_CMD( md, 3, 1, do_mem_md,
- "md - memory display\n",
- "md - memory display\n", "[.b, .w, .l] address [# of objects]\n - memory display\n"
);
What is the preferred command indentation in general?
- Tabs or spaces? eg: "dhcp\t- invoke DHCP client to obtain IP/boot params\n" "exit - exit script\n"
- What about commands that exceed the soft limit of 8 characters? Are they acceptable? Should there be a space between the command and the -? eg I currently see both: "interrupts - enable or disable interrupts\n" "reiserload- load binary file from a Reiser filesystem\n"
We've been "beautifying" customer-visible commands with more/less than 8 characters in the command help description and have standardized on using tabs for the sole reason that it very slightly reduces the binary size and is generally easier to align when adding new commands (ie someone doesn't have to go to another command and count the number of characters).
I've been using the following hokey shell command to find (hopefully) all command help messages: grep -r -A 2 U_BOOT_CMD ./* | grep -v U_BOOT_CMD | grep -v "--" | egrep "^.+",$" | awk '{sub("(^./.*.c-[ \t]+)", ""); print}'
I'd be happy to post these patches if desired. If so, I'll wait till I hear back about the preferred indentation method.
- Peter

Dear Peter,
In message 1219766722.11226.25.camel@localhost.localdomain you wrote:
On Tue, 2008-08-26 at 15:03 +0200, Wolfgang Denk wrote:
Bug was introced by "Big white-space cleanup" (53677ef1)
s/introced/introduced/
Thanks, too late. When I read your message, that commit was already pushed oout. Sorry.
What is the preferred command indentation in general?
- Tabs or spaces? eg:
"dhcp\t- invoke DHCP client to obtain IP/boot params\n" "exit - exit script\n"
TABs are preferred, as they save memory footprint for the U-Boot image. But for the help textx, this often makes the code hard to read and difficult to edit, so spaces are accepted here as well.
- What about commands that exceed the soft limit of 8 characters? Are
they acceptable? Should there be a space between the command and the -? eg I currently see both: "interrupts - enable or disable interrupts\n" "reiserload- load binary file from a Reiser filesystem\n"
Long command names should be avoided in general. If the name is exactly 8 characters, so that the '-' would align without a space between the name and the '-', then omit it; otherwise add it.
I'd be happy to post these patches if desired. If so, I'll wait till I hear back about the preferred indentation method.
Well, try and post them; probably on the next merge window.
Best regards,
Wolfgang Denk

What is the preferred command indentation in general?
- Tabs or spaces? eg:
"dhcp\t- invoke DHCP client to obtain IP/boot params\n" "exit - exit script\n"
TABs are preferred, as they save memory footprint for the U-Boot image. But for the help textx, this often makes the code hard to read and difficult to edit, so spaces are accepted here as well.
- What about commands that exceed the soft limit of 8 characters? Are
they acceptable? Should there be a space between the command and the -? eg I currently see both: "interrupts - enable or disable interrupts\n" "reiserload- load binary file from a Reiser filesystem\n"
Long command names should be avoided in general. If the name is exactly 8 characters, so that the '-' would align without a space between the name and the '-', then omit it; otherwise add it.
I'd be happy to post these patches if desired. If so, I'll wait till I hear back about the preferred indentation method.
Well, try and post them; probably on the next merge window.
Will do, thanks for the feedback, Peter
participants (2)
-
Peter Tyser
-
Wolfgang Denk