Thread (23 messages) flat view 23 messages, 2 authors, 2011-09-20

Re: [PATCH 06/20] of: Change logic to overwrite cmd_line with CONFIG_CMDLINE

From: Grant Likely <hidden>
Date: 2011-09-20 04:31:15

On Mon, Sep 19, 2011 at 9:44 PM, Benjamin Herrenschmidt
[off-list ref] wrote:
We used to overwrite with CONFIG_CMDLINE if we found a chosen
node but failed to get bootargs out of it or they were empty,
unless CONFIG_CMDLINE_FORCE is set.

Instead change that to overwrite if cmd_line is non empty after
the bootargs check. It allows arch code to have other mechanisms
to retrieve the command line prior to parsing the device-tree.

Note: CONFIG_CMDLINE_FORCE case should ideally be handled elsewhere
as it won't work as it-is if the device-tree has no /chosen node

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Grant Likely <redacted>

But while you're in there, you should comment what you described in
the commit text.  Namely that CONFIG_CMDLINE is a last resort if
nothing else managed to set the command line.

g.
quoted hunk ↗ jump to hunk
---
=A0drivers/of/fdt.c | =A0 =A02 +-
=A01 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 65200af..d382163 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -683,7 +683,7 @@ int __init early_init_dt_scan_chosen(unsigned long no=
de, const char *uname,
=A0#ifdef CONFIG_CMDLINE
=A0#ifndef CONFIG_CMDLINE_FORCE
- =A0 =A0 =A0 if (p =3D=3D NULL || l =3D=3D 0 || (l =3D=3D 1 && (*p) =3D=
=3D 0))
+ =A0 =A0 =A0 if (!cmd_line[0])
=A0#endif
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE=
_SIZE);
=A0#endif /* CONFIG_CMDLINE */
--
1.7.4.1

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help