Skip to contentSkip to conversation

cmd_mem.c: Fix help message alignment

PATCH New Wolfgang Denk 2 participants 5 messages Aug 26, 2008 – Sep 8, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd_mem.c: Fix help message alignment

Bug was introced by "Big white-space cleanup" (53677ef1)

---
 common/cmd_mem.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)
common/cmd_mem.c +15 -15
index a78355c..4766c24 100644
@@ -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 */
Signature · 1 line
1.5.3.3
#1 lore raw

PATCH 1/1 ADS5121: adjust image addresses in RAM and flash

Use the same mapping in flash as used by Linux

---
 include/configs/ads5121.h |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
include/configs/ads5121.h +9 -7
index d129ea3..5f74afb 100644
@@ -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 "			\
Signature · 1 line
1.5.3.3
#2 lore raw

PATCH 1/1 cmd_mem.c: Fix help message alignment

In reply to Wolfgang Denk
Quoted 1 line · Wolfgang Denk

Bug was introced by "Big white-space cleanup" (53677ef1)

s/introced/introduced/

Quoted 11 lines
---
 common/cmd_mem.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)
common/cmd_mem.c +0 -0
index a78355c..4766c24 100644

common/cmd_mem.c int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 1236

Quoted 8 lines
common/cmd_mem.c +1 -1
@@ -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

#3 lore raw

PATCH 1/1 cmd_mem.c: Fix help message alignment

Dear Peter,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 1 line · Wolfgang Denk

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.

Quoted 5 lines

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.

Quoted 5 lines

- 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.

Quoted 2 lines

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

Signature · 5 lines
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
Keep your eyes wide open before marriage, half shut afterwards.
                                                 -- Benjamin Franklin
#4 lore raw

PATCH 1/1 cmd_mem.c: Fix help message alignment

Quoted 16 lines
Quoted 5 lines

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.

Quoted 5 lines

- 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"

Quoted 8 lines

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.

Quoted 2 lines

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