Skip to contentSkip to conversation

Clean up Kconfig and source for a couple device tree commands.

PATCH In review Robert P. J. Day 4 participants 9 messages Jul 4, 2014 – Jul 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Clean up Kconfig and source for a couple device tree commands.

Correct options listings for a couple device tree-related commands.

---

i *think* the following is valid.

commands/Kconfig +2 -1
index eed6fbd..3248de9 100644
@@ -1950,10 +1950,11 @@ config CMD_OFTREE
 	help
 	  oftree - handle device trees
 
-	  Usage: oftree [-lpfdn] [DTB]
+	  Usage: oftree [-lspf] [DTB]
 
 	  Options:
 		  -l		Load DTB to internal device tree
+		  -s		save internal device tree to DTB
 		  -p		probe devices from stored device tree
 		  -f		free stored device tree
 
commands/of_dump.c +1 -1
index e341942..cafde07 100644
@@ -101,7 +101,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(of_dump)
 	.cmd		= do_of_dump,
 	BAREBOX_CMD_DESC("dump devicetree nodes")
-	BAREBOX_CMD_OPTS("[-f]")
+	BAREBOX_CMD_OPTS("[-f] [NODE]")
 	BAREBOX_CMD_GROUP(CMD_GRP_MISC)
 	BAREBOX_CMD_COMPLETE(devicetree_file_complete)
 	BAREBOX_CMD_HELP(cmd_of_dump_help)
commands/oftree.c +1 -1
index a3b0e04..983a0a5 100644
@@ -145,7 +145,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(oftree)
 	.cmd		= do_oftree,
 	BAREBOX_CMD_DESC("handle device trees")
-	BAREBOX_CMD_OPTS("[-lpfs]")
+	BAREBOX_CMD_OPTS("[-lspf]")
 	BAREBOX_CMD_GROUP(CMD_GRP_MISC)
 	BAREBOX_CMD_HELP(cmd_oftree_help)
 BAREBOX_CMD_END
Signature · 12 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 8 lines · Robert P. J. Day

Correct options listings for a couple device tree-related commands.

---

i *think* the following is valid.

Looks all good. Applied, thanks

Sascha

Quoted 60 lines
commands/Kconfig +2 -1
index eed6fbd..3248de9 100644
@@ -1950,10 +1950,11 @@ config CMD_OFTREE
 	help
 	  oftree - handle device trees
 
-	  Usage: oftree [-lpfdn] [DTB]
+	  Usage: oftree [-lspf] [DTB]
 
 	  Options:
 		  -l		Load DTB to internal device tree
+		  -s		save internal device tree to DTB
 		  -p		probe devices from stored device tree
 		  -f		free stored device tree
 
commands/of_dump.c +1 -1
index e341942..cafde07 100644
@@ -101,7 +101,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(of_dump)
 	.cmd		= do_of_dump,
 	BAREBOX_CMD_DESC("dump devicetree nodes")
-	BAREBOX_CMD_OPTS("[-f]")
+	BAREBOX_CMD_OPTS("[-f] [NODE]")
 	BAREBOX_CMD_GROUP(CMD_GRP_MISC)
 	BAREBOX_CMD_COMPLETE(devicetree_file_complete)
 	BAREBOX_CMD_HELP(cmd_of_dump_help)
commands/oftree.c +1 -1
index a3b0e04..983a0a5 100644
@@ -145,7 +145,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(oftree)
 	.cmd		= do_oftree,
 	BAREBOX_CMD_DESC("handle device trees")
-	BAREBOX_CMD_OPTS("[-lpfs]")
+	BAREBOX_CMD_OPTS("[-lspf]")
 	BAREBOX_CMD_GROUP(CMD_GRP_MISC)
 	BAREBOX_CMD_HELP(cmd_oftree_help)
 BAREBOX_CMD_END
Signature · 14 lines
-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
In reply to Robert P. J. Day
Quoted 17 lines · Robert P. J. Day

Correct options listings for a couple device tree-related commands.

---

i *think* the following is valid.

commands/Kconfig +0 -0
index eed6fbd..3248de9 100644
@@ -1950,10 +1950,11 @@ config CMD_OFTREE
 	help
 	  oftree - handle device trees

commands/Kconfig config CMD_OFTREE · line 1960

Quoted 10 lines
commands/Kconfig +2 -1
 
-	  Usage: oftree [-lpfdn] [DTB]
+	  Usage: oftree [-lspf] [DTB]
 
 	  Options:
 		  -l		Load DTB to internal device tree
+		  -s		save internal device tree to DTB
 		  -p		probe devices from stored device tree
 		  -f		free stored device tree
 

do we really need the help here

it’s a pain in the ass to keep it sync

Quoted 25 lines
commands/of_dump.c +1 -1
index e341942..cafde07 100644
@@ -101,7 +101,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(of_dump)
 	.cmd		= do_of_dump,
 	BAREBOX_CMD_DESC("dump devicetree nodes")
-	BAREBOX_CMD_OPTS("[-f]")
+	BAREBOX_CMD_OPTS("[-f] [NODE]")
 	BAREBOX_CMD_GROUP(CMD_GRP_MISC)
 	BAREBOX_CMD_COMPLETE(devicetree_file_complete)
 	BAREBOX_CMD_HELP(cmd_of_dump_help)
commands/oftree.c +1 -1
index a3b0e04..983a0a5 100644
@@ -145,7 +145,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(oftree)
 	.cmd		= do_oftree,
 	BAREBOX_CMD_DESC("handle device trees")
-	BAREBOX_CMD_OPTS("[-lpfs]")
+	BAREBOX_CMD_OPTS("[-lspf]")
 	BAREBOX_CMD_GROUP(CMD_GRP_MISC)
 	BAREBOX_CMD_HELP(cmd_oftree_help)
Quoted 16 lines

BAREBOX_CMD_END

Signature · 12 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                       http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw
Quoted 33 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 17 lines · Robert P. J. Day

Correct options listings for a couple device tree-related commands.

---

i *think* the following is valid.

commands/Kconfig +0 -0
index eed6fbd..3248de9 100644
@@ -1950,10 +1950,11 @@ config CMD_OFTREE
 	help
 	  oftree - handle device trees

commands/Kconfig config CMD_OFTREE · line 1960

Quoted 10 lines
commands/Kconfig +2 -1
 
-	  Usage: oftree [-lpfdn] [DTB]
+	  Usage: oftree [-lspf] [DTB]
 
 	  Options:
 		  -l		Load DTB to internal device tree
+		  -s		save internal device tree to DTB
 		  -p		probe devices from stored device tree
 		  -f		free stored device tree
 

do we really need the help here

Quoted 1 line

it’s a pain in the ass to keep it sync

... snip ...

i'd have to agree ... there's quite a lot of help info that's out of
sync between the Kconfig entries and the source file entries. for example, check out the Kconfig entry for the "boot" command:

config CMD_BOOT
tristate
select BOOTM
prompt "boot"
help
... snip ...
Options:
-c crc check uImage data
-d dryrun: check data, but do not run
-f load images even if type is undetectable
-r INITRD specify an initrd image
-L ADDR specify initrd load address
-a ADDR specify os load address
-e OFFS entry point to the image relative to start (0)
-o DTS specify open firmware device tree
-v verbose

versus what's in the command source file:

BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT ("-v","Increase verbosity") BAREBOX_CMD_HELP_OPT ("-d","Dryrun. See what happens but do no actually boot") BAREBOX_CMD_HELP_OPT ("-l","List available boot sources") BAREBOX_CMD_HELP_OPT ("-m","Show a menu with boot options") BAREBOX_CMD_HELP_OPT ("-t SECS","specify timeout in SECS") BAREBOX_CMD_HELP_END

and there are quite a few other examples of mismatches like that.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#4 lore raw
Quoted 70 lines · Robert P. J. Day
Quoted 33 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 17 lines · Robert P. J. Day

Correct options listings for a couple device tree-related commands.

---

i *think* the following is valid.

commands/Kconfig +0 -0
index eed6fbd..3248de9 100644
@@ -1950,10 +1950,11 @@ config CMD_OFTREE
 	help
 	  oftree - handle device trees

commands/Kconfig config CMD_OFTREE · line 1960

Quoted 10 lines
commands/Kconfig +2 -1
 
-	  Usage: oftree [-lpfdn] [DTB]
+	  Usage: oftree [-lspf] [DTB]
 
 	  Options:
 		  -l		Load DTB to internal device tree
+		  -s		save internal device tree to DTB
 		  -p		probe devices from stored device tree
 		  -f		free stored device tree
 

do we really need the help here

Quoted 1 line

it’s a pain in the ass to keep it sync

... snip ...

i'd have to agree ... there's quite a lot of help info that's out of
sync between the Kconfig entries and the source file entries. for example, check out the Kconfig entry for the "boot" command:

config CMD_BOOT
tristate
select BOOTM
prompt "boot"
help
... snip ...
Options:
-c crc check uImage data
-d dryrun: check data, but do not run
-f load images even if type is undetectable
-r INITRD specify an initrd image
-L ADDR specify initrd load address
-a ADDR specify os load address
-e OFFS entry point to the image relative to start (0)
-o DTS specify open firmware device tree
-v verbose

versus what's in the command source file:

BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT ("-v","Increase verbosity") BAREBOX_CMD_HELP_OPT ("-d","Dryrun. See what happens but do no actually boot") BAREBOX_CMD_HELP_OPT ("-l","List available boot sources") BAREBOX_CMD_HELP_OPT ("-m","Show a menu with boot options") BAREBOX_CMD_HELP_OPT ("-t SECS","specify timeout in SECS") BAREBOX_CMD_HELP_END

Quoted 1 line

and there are quite a few other examples of mismatches like that.

So we should simply drop them from Kconfig

Best Regards,
J.

Quoted 12 lines

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw
Quoted 5 lines

I tend to agree here. When Holger sent these patches recently I was very pleased that he has put some love into the Kconfig files. Bit indeed it is very hard (and unnecessary) work to keep them in sync. Holger, what's your take on this? Is our new (and yet-to-be-uploaded-to-the-net) Documentation prominent enough to drop the usage from Kconfig?

In the long run, I'd like to put a help on all Kconfig entries.

When I was new to Barebox, and started "make xconfig" and was partially pleased (because make xconfig worked), but also puzzled, because so many Kconfig entries did not contain any help text. It was not easy for me to decide if I need an option or not, or if that option would just be a nice-to-have one.

From that point of view I like the helps on the commands. They give you all the info you need to immediately knoy if you want to put a check there --- or not.

However, Kconfig files are relatively easy to parse (or to write). So we could declare one option as the "main" source and write a python program that reads the main source and generates the others out of it.
It's probably me who should write that ... grin.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#6 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 33 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 17 lines · Robert P. J. Day

Correct options listings for a couple device tree-related commands.

---

i *think* the following is valid.

commands/Kconfig +0 -0
index eed6fbd..3248de9 100644
@@ -1950,10 +1950,11 @@ config CMD_OFTREE
 	help
 	  oftree - handle device trees

commands/Kconfig config CMD_OFTREE · line 1960

Quoted 10 lines
commands/Kconfig +2 -1
 
-	  Usage: oftree [-lpfdn] [DTB]
+	  Usage: oftree [-lspf] [DTB]
 
 	  Options:
 		  -l		Load DTB to internal device tree
+		  -s		save internal device tree to DTB
 		  -p		probe devices from stored device tree
 		  -f		free stored device tree
 

do we really need the help here

Quoted 1 line

it’s a pain in the ass to keep it sync

as a followup to my reply, if it were me, i would just toss all the
usage/synopsis info from the Kconfig help -- as the OP quite correctly points out, it's a pain in the ass to keep it sync'ed with the source, and i've already run across several commands whose Kconfig help doesn't match the source.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#7 lore raw
Quoted 35 lines · Robert P. J. Day
Quoted 33 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 17 lines · Robert P. J. Day

Correct options listings for a couple device tree-related commands.

---

i *think* the following is valid.

commands/Kconfig +0 -0
index eed6fbd..3248de9 100644
@@ -1950,10 +1950,11 @@ config CMD_OFTREE
 	help
 	  oftree - handle device trees

commands/Kconfig config CMD_OFTREE · line 1960

Quoted 10 lines
commands/Kconfig +2 -1
 
-	  Usage: oftree [-lpfdn] [DTB]
+	  Usage: oftree [-lspf] [DTB]
 
 	  Options:
 		  -l		Load DTB to internal device tree
+		  -s		save internal device tree to DTB
 		  -p		probe devices from stored device tree
 		  -f		free stored device tree
 

do we really need the help here

Quoted 7 lines
Quoted 1 line

it’s a pain in the ass to keep it sync

as a followup to my reply, if it were me, i would just toss all the
usage/synopsis info from the Kconfig help -- as the OP quite correctly points out, it's a pain in the ass to keep it sync'ed with the source, and i've already run across several commands whose Kconfig help doesn't match the source.

I tend to agree here. When Holger sent these patches recently I was very pleased that he has put some love into the Kconfig files. Bit indeed it is very hard (and unnecessary) work to keep them in sync. Holger, what's your take on this? Is our new (and yet-to-be-uploaded-to-the-net) Documentation prominent enough to drop the usage from Kconfig?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw
Quoted 2 lines

Is our new (and yet-to-be-uploaded-to-the-net) Documentation prominent enough to drop the usage from Kconfig?

I don't think so. I cannot see that someone has xconfig option, and at the same time the just alphebetically sorted new html documentation ... that's cumbersome, isn't it?

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox