mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Some patches
@ 2010-11-01  8:26 Robert Schwebel
  2010-11-01  8:26 ` [PATCH 1/5] devinfo: use subtree only with devinfo Robert Schwebel
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Robert Schwebel @ 2010-11-01  8:26 UTC (permalink / raw)
  To: barebox

This series contains some random patches for barebox.

rsc
-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/5] devinfo: use subtree only with devinfo
  2010-11-01  8:26 Some patches Robert Schwebel
@ 2010-11-01  8:26 ` Robert Schwebel
  2010-11-01  8:26 ` [PATCH 2/5] sandbox: use devfs functions only if defined Robert Schwebel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Schwebel @ 2010-11-01  8:26 UTC (permalink / raw)
  To: barebox

The do_devinfo_subtree() function is only used if devinfo is compiled
in, so put it under the same ifdef. This avoids the following warning
when built with allnoconfig:

lib/driver.c:247: warning: 'do_devinfo_subtree' defined but not used

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 lib/driver.c |   42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/lib/driver.c b/lib/driver.c
index 66d8fee..a05e7e3 100644
--- a/lib/driver.c
+++ b/lib/driver.c
@@ -244,6 +244,27 @@ int dummy_probe(struct device_d *dev)
 }
 EXPORT_SYMBOL(dummy_probe);
 
+const char *dev_id(const struct device_d *dev)
+{
+	static char buf[sizeof(unsigned long) * 2];
+
+	sprintf(buf, FORMAT_DRIVER_MANE_ID, dev->name, dev->id);
+
+	return buf;
+}
+
+void devices_shutdown(void)
+{
+	struct device_d *dev;
+
+	list_for_each_entry(dev, &active, active) {
+		if (dev->driver->remove)
+			dev->driver->remove(dev);
+	}
+}
+
+#ifdef CONFIG_CMD_DEVINFO
+
 static int do_devinfo_subtree(struct device_d *dev, int depth, char edge)
 {
 	struct device_d *child;
@@ -276,27 +297,6 @@ static int do_devinfo_subtree(struct device_d *dev, int depth, char edge)
 	return 0;
 }
 
-const char *dev_id(const struct device_d *dev)
-{
-	static char buf[sizeof(unsigned long) * 2];
-
-	sprintf(buf, FORMAT_DRIVER_MANE_ID, dev->name, dev->id);
-
-	return buf;
-}
-
-void devices_shutdown(void)
-{
-	struct device_d *dev;
-
-	list_for_each_entry(dev, &active, active) {
-		if (dev->driver->remove)
-			dev->driver->remove(dev);
-	}
-}
-
-#ifdef CONFIG_CMD_DEVINFO
-
 static int do_devinfo(struct command *cmdtp, int argc, char *argv[])
 {
 	struct device_d *dev;
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/5] sandbox: use devfs functions only if defined
  2010-11-01  8:26 Some patches Robert Schwebel
  2010-11-01  8:26 ` [PATCH 1/5] devinfo: use subtree only with devinfo Robert Schwebel
@ 2010-11-01  8:26 ` Robert Schwebel
  2010-11-01  8:26 ` [PATCH 3/5] digest: align menu Robert Schwebel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Schwebel @ 2010-11-01  8:26 UTC (permalink / raw)
  To: barebox

arch/sandbox/board/built-in.o: In function `hf_probe':
hostfile.c:(.text+0xac): undefined reference to `devfs_create'

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 arch/sandbox/board/hostfile.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index ad625d7..38a52a8 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -79,7 +79,9 @@ static int hf_probe(struct device_d *dev)
 	priv->cdev.size = hf->size;
 	priv->cdev.ops = &hf_fops;
 	priv->cdev.priv = hf;
+#ifdef CONFIG_FS_DEVFS
 	devfs_create(&priv->cdev);
+#endif
 
 	return 0;
 }
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/5] digest: align menu
  2010-11-01  8:26 Some patches Robert Schwebel
  2010-11-01  8:26 ` [PATCH 1/5] devinfo: use subtree only with devinfo Robert Schwebel
  2010-11-01  8:26 ` [PATCH 2/5] sandbox: use devfs functions only if defined Robert Schwebel
@ 2010-11-01  8:26 ` Robert Schwebel
  2010-11-01  8:26 ` [PATCH 4/5] allno: make simple shell the default Robert Schwebel
  2010-11-01  8:26 ` [PATCH 5/5] parser: use debug macros Robert Schwebel
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Schwebel @ 2010-11-01  8:26 UTC (permalink / raw)
  To: barebox

Align with the other menu entries.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 lib/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Kconfig b/lib/Kconfig
index 9eca161..ad2b3cf 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -11,7 +11,7 @@ config CRC16
 	bool
 
 menuconfig DIGEST
-	bool "Digest"
+	bool "Digest                        "
 
 if DIGEST
 
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/5] allno: make simple shell the default
  2010-11-01  8:26 Some patches Robert Schwebel
                   ` (2 preceding siblings ...)
  2010-11-01  8:26 ` [PATCH 3/5] digest: align menu Robert Schwebel
@ 2010-11-01  8:26 ` Robert Schwebel
  2010-11-01 10:44   ` Sascha Hauer
  2010-11-01  8:26 ` [PATCH 5/5] parser: use debug macros Robert Schwebel
  4 siblings, 1 reply; 8+ messages in thread
From: Robert Schwebel @ 2010-11-01  8:26 UTC (permalink / raw)
  To: barebox

Reorder the shells in Kconfig, in order to make the simple shell the
default over hush. For the sandbox_defconfig this makes the image
smaller:

before:
-rwxr-xr-x 1 rsc ptx 60747 Oct 29 09:19 barebox

after:
-rwxr-xr-x 1 rsc ptx 53275 Oct 29 09:18 barebox

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 common/Kconfig |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index ad70cde..54a40e9 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -214,16 +214,16 @@ config MAXARGS
 choice
 	prompt "Select your shell"
 
+	config SHELL_SIMPLE
+		bool "Simple parser"
+		help
+		  simple shell. No if/then, no return values from commands, no loops
+
 	config SHELL_HUSH
 		bool "hush parser"
 		help
 		  Enable hush support. This is the most advanced shell available
 		  for barebox.
-
-	config SHELL_SIMPLE
-		bool "Simple parser"
-		help
-		  simple shell. No if/then, no return values from commands, no loops
 endchoice
 
 config GLOB
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/5] parser: use debug macros
  2010-11-01  8:26 Some patches Robert Schwebel
                   ` (3 preceding siblings ...)
  2010-11-01  8:26 ` [PATCH 4/5] allno: make simple shell the default Robert Schwebel
@ 2010-11-01  8:26 ` Robert Schwebel
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Schwebel @ 2010-11-01  8:26 UTC (permalink / raw)
  To: barebox

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 common/parser.c |   51 +++++++++++++++++++++++----------------------------
 1 files changed, 23 insertions(+), 28 deletions(-)

diff --git a/common/parser.c b/common/parser.c
index 97e354b..fd578c7 100644
--- a/common/parser.c
+++ b/common/parser.c
@@ -6,9 +6,8 @@ static int parse_line (char *line, char *argv[])
 {
 	int nargs = 0;
 
-#ifdef DEBUG_PARSER
-	printf ("parse_line: \"%s\"\n", line);
-#endif
+	pr_debug("parse_line: \"%s\"\n", line);
+
 	while (nargs < CONFIG_MAXARGS) {
 
 		/* skip any white space */
@@ -18,9 +17,9 @@ static int parse_line (char *line, char *argv[])
 
 		if (*line == '\0') {	/* end of line, no more args	*/
 			argv[nargs] = NULL;
-#ifdef DEBUG_PARSER
-		printf ("parse_line: nargs=%d\n", nargs);
-#endif
+
+		pr_debug("parse_line: nargs=%d\n", nargs);
+
 			return (nargs);
 		}
 
@@ -33,9 +32,9 @@ static int parse_line (char *line, char *argv[])
 
 		if (*line == '\0') {	/* end of line, no more args	*/
 			argv[nargs] = NULL;
-#ifdef DEBUG_PARSER
-		printf ("parse_line: nargs=%d\n", nargs);
-#endif
+
+		pr_debug("parse_line: nargs=%d\n", nargs);
+
 			return (nargs);
 		}
 
@@ -43,10 +42,8 @@ static int parse_line (char *line, char *argv[])
 	}
 
 	printf ("** Too many args (max. %d) **\n", CONFIG_MAXARGS);
+	pr_debug("parse_line: nargs=%d\n", nargs);
 
-#ifdef DEBUG_PARSER
-	printf ("parse_line: nargs=%d\n", nargs);
-#endif
 	return (nargs);
 }
 
@@ -61,12 +58,12 @@ static void process_macros (const char *input, char *output)
 	/* 1 = waiting for '(' or '{' */
 	/* 2 = waiting for ')' or '}' */
 	/* 3 = waiting for '''  */
-#ifdef DEBUG_PARSER
+#ifdef DEBUG
 	char *output_start = output;
+#endif
 
-	printf ("[PROCESS_MACROS] INPUT len %d: \"%s\"\n", strlen (input),
+	pr_debug("[PROCESS_MACROS] INPUT len %d: \"%s\"\n", strlen (input),
 		input);
-#endif
 
 	prev = '\0';		/* previous character   */
 
@@ -153,10 +150,8 @@ static void process_macros (const char *input, char *output)
 	if (outputcnt)
 		*output = 0;
 
-#ifdef DEBUG_PARSER
-	printf ("[PROCESS_MACROS] OUTPUT len %d: \"%s\"\n",
+	pr_debug("[PROCESS_MACROS] OUTPUT len %d: \"%s\"\n",
 		strlen (output_start), output_start);
-#endif
 }
 
 /****************************************************************************
@@ -185,8 +180,8 @@ int run_command (const char *cmd, int flag)
 	int argc, inquotes;
 	int rc = 0;
 
-#ifdef DEBUG_PARSER
-	printf ("[RUN_COMMAND] cmd[%p]=\"", cmd);
+#ifdef DEBUG
+	pr_debug("[RUN_COMMAND] cmd[%p]=\"", cmd);
 	puts (cmd ? cmd : "NULL");	/* use puts - string may be loooong */
 	puts ("\"\n");
 #endif
@@ -202,13 +197,13 @@ int run_command (const char *cmd, int flag)
 
 	strcpy (cmdbuf, cmd);
 
-	/* Process separators and check for invalid
+	/*
+	 * Process separators and check for invalid
 	 * repeatable commands
 	 */
 
-#ifdef DEBUG_PARSER
-	printf ("[PROCESS_SEPARATORS] %s\n", cmd);
-#endif
+	pr_debug("[PROCESS_SEPARATORS] %s\n", cmd);
+
 	while (*str) {
 
 		/*
@@ -235,11 +230,11 @@ int run_command (const char *cmd, int flag)
 			str = sep + 1;	/* start of command for next pass */
 			*sep = '\0';
 		}
-		else
+		else {
 			str = sep;	/* no more commands for next pass */
-#ifdef DEBUG_PARSER
-		printf ("token: \"%s\"\n", token);
-#endif
+		}
+
+		pr_debug("token: \"%s\"\n", token);
 
 		/* find macros in this token and replace them */
 		process_macros (token, finaltoken);
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/5] allno: make simple shell the default
  2010-11-01  8:26 ` [PATCH 4/5] allno: make simple shell the default Robert Schwebel
@ 2010-11-01 10:44   ` Sascha Hauer
  2010-11-01 11:01     ` Robert Schwebel
  0 siblings, 1 reply; 8+ messages in thread
From: Sascha Hauer @ 2010-11-01 10:44 UTC (permalink / raw)
  To: Robert Schwebel; +Cc: barebox

On Mon, Nov 01, 2010 at 09:26:18AM +0100, Robert Schwebel wrote:
> Reorder the shells in Kconfig, in order to make the simple shell the
> default over hush.

The simple shell is mostly unused in barebox and most boards depend on
hush in their default environment. It shouldn't be made default.

Sascha


-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/5] allno: make simple shell the default
  2010-11-01 10:44   ` Sascha Hauer
@ 2010-11-01 11:01     ` Robert Schwebel
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Schwebel @ 2010-11-01 11:01 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Mon, Nov 01, 2010 at 11:44:25AM +0100, Sascha Hauer wrote:
> On Mon, Nov 01, 2010 at 09:26:18AM +0100, Robert Schwebel wrote:
> > Reorder the shells in Kconfig, in order to make the simple shell the
> > default over hush.
>
> The simple shell is mostly unused in barebox and most boards depend on
> hush in their default environment. It shouldn't be made default.

I would expect 'make allnoconfig' to make a minimum image, but it
currently builds in hush. Any idea how to solve this?

rsc
-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-11-01 11:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-01  8:26 Some patches Robert Schwebel
2010-11-01  8:26 ` [PATCH 1/5] devinfo: use subtree only with devinfo Robert Schwebel
2010-11-01  8:26 ` [PATCH 2/5] sandbox: use devfs functions only if defined Robert Schwebel
2010-11-01  8:26 ` [PATCH 3/5] digest: align menu Robert Schwebel
2010-11-01  8:26 ` [PATCH 4/5] allno: make simple shell the default Robert Schwebel
2010-11-01 10:44   ` Sascha Hauer
2010-11-01 11:01     ` Robert Schwebel
2010-11-01  8:26 ` [PATCH 5/5] parser: use debug macros Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox