[{"id":2644190,"web_url":"http://patchwork.ozlabs.org/comment/2644190/","msgid":"<f0726e42-87bd-48a1-69da-c667a9394d2d@csgroup.eu>","date":"2021-03-09T07:36:42","subject":"Re: [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section","submitter":{"id":79086,"url":"http://patchwork.ozlabs.org/api/people/79086/","name":"Christophe Leroy","email":"christophe.leroy@csgroup.eu"},"content":"Le 09/03/2021 à 01:02, Daniel Walker a écrit :\n> It looks like there's some seepage of cmdline stuff into\n> the generic device tree code. This conflicts with the\n> generic cmdline implementation so I remove it in the case\n> when that's enabled.\n> \n> Cc: xe-linux-external@cisco.com\n> Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>\n> Signed-off-by: Daniel Walker <danielwa@cisco.com>\n> ---\n>   drivers/of/fdt.c | 12 ++++++++++++\n>   1 file changed, 12 insertions(+)\n> \n> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c\n> index feb0f2d67fc5..e25240d84632 100644\n> --- a/drivers/of/fdt.c\n> +++ b/drivers/of/fdt.c\n> @@ -25,6 +25,7 @@\n>   #include <linux/serial_core.h>\n>   #include <linux/sysfs.h>\n>   #include <linux/random.h>\n> +#include <linux/cmdline.h>\n>   \n>   #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */\n>   #include <asm/page.h>\n> @@ -1050,6 +1051,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n>   \n>   \t/* Retrieve command line */\n>   \tp = of_get_flat_dt_prop(node, \"bootargs\", &l);\n> +\n> +#ifdef CONFIG_GENERIC_CMDLINE\n> +\t/*\n> +\t * The builtin command line will be added here, or it can override\n> +\t * with the DT bootargs.\n> +\t */\n> +\tcmdline_add_builtin(data,\n> +\t\t\t    (l > 0 ? p : NULL), /* This is sanity checking */\n> +\t\t\t    COMMAND_LINE_SIZE);\n\nI don't think the comment is needed.\nWithout the comment, it should fit on a single line, would be better for readability and grepability.\n\n> +#else\n>   \tif (p != NULL && l > 0)\n>   \t\tstrlcpy(data, p, min(l, COMMAND_LINE_SIZE));\n>   \n> @@ -1070,6 +1081,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,\n>   \t\tstrlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);\n>   #endif\n>   #endif /* CONFIG_CMDLINE */\n> +#endif /* CONFIG_GENERIC_CMDLINE */\n>   \n>   \tpr_debug(\"Command line is: %s\\n\", (char *)data);\n>   \n> \n\nChristophe","headers":{"Return-Path":"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)","lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=csgroup.eu (client-ip=93.17.236.30; helo=pegase1.c-s.fr;\n envelope-from=christophe.leroy@csgroup.eu; receiver=<UNKNOWN>)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4Dvn8x6z3bz9sW1\n\tfor <patchwork-incoming@ozlabs.org>; Tue,  9 Mar 2021 18:37:05 +1100 (AEDT)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4Dvn8x5x0Qz30Nj\n\tfor <patchwork-incoming@ozlabs.org>; Tue,  9 Mar 2021 18:37:05 +1100 (AEDT)","from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4Dvn8d3qLHz30J0\n for <linuxppc-dev@lists.ozlabs.org>; Tue,  9 Mar 2021 18:36:49 +1100 (AEDT)","from localhost (mailhub1-int [192.168.12.234])\n by localhost (Postfix) with ESMTP id 4Dvn8V5RM2z9txlJ;\n Tue,  9 Mar 2021 08:36:42 +0100 (CET)","from pegase1.c-s.fr ([192.168.12.234])\n by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024)\n with ESMTP id fO6AsbOF6a1J; Tue,  9 Mar 2021 08:36:42 +0100 (CET)","from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192])\n by pegase1.c-s.fr (Postfix) with ESMTP id 4Dvn8V3Bz5z9txlH;\n Tue,  9 Mar 2021 08:36:42 +0100 (CET)","from localhost (localhost [127.0.0.1])\n by messagerie.si.c-s.fr (Postfix) with ESMTP id 763338B7CE;\n Tue,  9 Mar 2021 08:36:43 +0100 (CET)","from messagerie.si.c-s.fr ([127.0.0.1])\n by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023)\n with ESMTP id m52LPb2e7w7l; Tue,  9 Mar 2021 08:36:43 +0100 (CET)","from [192.168.4.90] (unknown [192.168.4.90])\n by messagerie.si.c-s.fr (Postfix) with ESMTP id A20F08B773;\n Tue,  9 Mar 2021 08:36:42 +0100 (CET)"],"X-Virus-Scanned":["Debian amavisd-new at c-s.fr","amavisd-new at c-s.fr"],"Subject":"Re: [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section","To":"Daniel Walker <danielwa@cisco.com>, Will Deacon <will@kernel.org>,\n Rob Herring <robh@kernel.org>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Andrew Morton <akpm@linux-foundation.org>, x86@kernel.org,\n linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,\n xe-linux-external@cisco.com, Rob Herring <robh+dt@kernel.org>,\n Frank Rowand <frowand.list@gmail.com>","References":"<20210309000247.2989531-3-danielwa@cisco.com>","From":"Christophe Leroy <christophe.leroy@csgroup.eu>","Message-ID":"<f0726e42-87bd-48a1-69da-c667a9394d2d@csgroup.eu>","Date":"Tue, 9 Mar 2021 08:36:42 +0100","User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101\n Thunderbird/78.8.0","MIME-Version":"1.0","In-Reply-To":"<20210309000247.2989531-3-danielwa@cisco.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"fr","Content-Transfer-Encoding":"8bit","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"devicetree@vger.kernel.org, Ruslan Ruslichenko <rruslich@cisco.com>,\n linux-kernel@vger.kernel.org","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]