From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 338EDB74C0 for ; Sun, 11 Sep 2011 00:20:25 +1000 (EST) From: Benjamin Herrenschmidt To: linuxppc-dev@ozlabs.org Subject: [PATCH 07/21] of: Change logic to overwrite cmd_line with CONFIG_CMDLINE Date: Sat, 10 Sep 2011 11:19:54 -0300 Message-Id: <1315664408-16797-7-git-send-email-benh@kernel.crashing.org> In-Reply-To: <1315664408-16797-1-git-send-email-benh@kernel.crashing.org> References: <1315664408-16797-1-git-send-email-benh@kernel.crashing.org> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- drivers/of/fdt.c | 2 +- 1 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 node, const char *uname, #ifdef CONFIG_CMDLINE #ifndef CONFIG_CMDLINE_FORCE - if (p == NULL || l == 0 || (l == 1 && (*p) == 0)) + if (!cmd_line[0]) #endif strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); #endif /* CONFIG_CMDLINE */ -- 1.7.4.1