Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4637523pxf; Tue, 30 Mar 2021 12:54:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxa2ZbIdZ9H9+kN8pXmdjJ0TgUrFyckoasFyFjZv4jbZP08LIRe6akH3Mx2ZYlkJumqM5KE X-Received: by 2002:a05:6402:31b7:: with SMTP id dj23mr36222062edb.245.1617134041964; Tue, 30 Mar 2021 12:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617134041; cv=none; d=google.com; s=arc-20160816; b=geXlIToO66N18E8QvQNsjVk7C1cYqa3lbkSLRycq4nYUl+nIYW2KEMcuVMMJn4IyaY fU6A99fxH3QkZmVErxHGF4tngTWW6PzPkBt7iPeNDe3z6mq4DboYsN+KpHCfl0ESXfYF NVfmkZ3j0fpeoEr7fzVdZG2tmmv8wt/I/ScWa2i1Xs/eBzWvqYeImUKOtWv92w58AlqV R8/amD6nNqCPSSNjVdrv7edgzDw22sK+xkIXtQw0kYKW/tO9+h1XhGcliGt5WOAfa5uc 2bTQnlv7OkZgZp+BnA7lV5GfRynFqy+4BmYy6kqOVnuqgHLhTqjtkAHj5Sks7cbZ/8Rm kTKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vqi+zgN2yP3PflgJiCZM7r1BcxHblNb+Y2L5rUa8q5k=; b=bLw6JiPmnrbTKCP9g2ZmchUbUGYaJrR2dh2PpoNJRYp2lK556NvRryFkMDMOOVvuTo /PO+5kAVUA6xf1YMKnn/8RYcshv6Y0NzhaF1EPT05ZrAcyjxHvgUaLvFd7R0UTC+IDpP vkCrCWcxPTytDnS/fRxoZzZo9oVHzEjcOTQUA9xJ+WZlv3DlW7iDrl4ptkPdjkE3Z0eS H1oEljkfy8v6V7h0/nas8iA1duOB5cVF4y1+WYXZgn6oiPIvxTEl08F+5JDsDIAw8HKX l5z297lkdM95+O3fORsacuXTPyx2FGvFXaYDfPwoM0CepBdyWKPFf+aRaYPyKXkI/n3Y hzWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gEcNh7zo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si15880699ejd.658.2021.03.30.12.53.38; Tue, 30 Mar 2021 12:54:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gEcNh7zo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233260AbhC3Tt7 (ORCPT + 99 others); Tue, 30 Mar 2021 15:49:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:57338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233254AbhC3Tt1 (ORCPT ); Tue, 30 Mar 2021 15:49:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0ACA761919; Tue, 30 Mar 2021 19:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617133767; bh=Ck1XHsPMXKddkO7/YY+lWQc5sW8Ayvngr37xovx4Afg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gEcNh7zo1605nJ8Hjwu4y4qAZxIi22sCNRw5bFtvEBODv+GcaOmodshXmLvXjV/t4 yDViKbTiOEZs8Xg7AxAUYTWED/fmy1qnnrA6cnzJVkJU5ys2Fm9MoVyedghkW76SwD FCOVQBFKbAQQ986t/02MAQqbdli2694er9Ec9kjMM7c5EVZRW8UCgbTQQ2vQMM8dbT cimawJ7XvGtVIF9UwsSj9od7XaLHi9WEre1AKUaxPm6rzJc/+RlXz9yJaWBASK3oYK OhmRDT63nchAo7rm+sZqwAUBD4bVS10/D/ito1bQGxYshGgyNTN6AZm36Wic4i6V/d 1lysvtPWpYsDA== Received: by mail-ej1-f43.google.com with SMTP id e14so26541621ejz.11; Tue, 30 Mar 2021 12:49:26 -0700 (PDT) X-Gm-Message-State: AOAM531mFG1fBVx0Jn4FbCpJeTYrw9hLavDElHtfHsQwzNKTne9ME212 0EoSH7Wn63FB4exHxl/z4GYXBwJT5N8k8/jqZw== X-Received: by 2002:a17:906:c405:: with SMTP id u5mr35182498ejz.341.1617133765515; Tue, 30 Mar 2021 12:49:25 -0700 (PDT) MIME-Version: 1.0 References: <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com> <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com> In-Reply-To: <0c4b839f023f87c451c8aa3c4f7a8d92729c2f02.1617126961.git.danielwa@cisco.com> From: Rob Herring Date: Tue, 30 Mar 2021 14:49:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section To: Daniel Walker Cc: Will Deacon , Christophe Leroy , Daniel Gimpelevich , Andrew Morton , X86 ML , "open list:MIPS" , linuxppc-dev , Frank Rowand , xe-linux-external@cisco.com, Ruslan Ruslichenko , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 12:57 PM Daniel Walker wrote: > > It looks like there's some seepage of cmdline stuff into > the generic device tree code. This conflicts with the > generic cmdline implementation so I remove it in the case > when that's enabled. > > Cc: xe-linux-external@cisco.com > Signed-off-by: Ruslan Ruslichenko > Signed-off-by: Daniel Walker > --- > drivers/of/fdt.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index dcc1dd96911a..d8805cd9717a 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > #include /* for COMMAND_LINE_SIZE */ > #include > @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, > > /* Retrieve command line */ > p = of_get_flat_dt_prop(node, "bootargs", &l); > + > +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF) Moving in the wrong direction... This code already has too many #ifdef's. I like Christophe's version as it gets rid of all the code here. > + /* > + * The builtin command line will be added here, or it can override > + * with the DT bootargs. > + */ > + cmdline_add_builtin(data, > + (l > 0 ? p : NULL), /* This is sanity checking */ > + COMMAND_LINE_SIZE); > +#elif defined(CONFIG_GENERIC_CMDLINE) > + strlcpy(data, p, COMMAND_LINE_SIZE); > +#else > if (p != NULL && l > 0) > strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); > > @@ -1070,6 +1083,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, > strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); > #endif > #endif /* CONFIG_CMDLINE */ > +#endif /* CONFIG_GENERIC_CMDLINE */ > > pr_debug("Command line is: %s\n", (char *)data); > > -- > 2.25.1 >