[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL_JsqJphExyTqEejMnM07NOgPyZ5hGLJunY6yXYm16WT+PGCQ@mail.gmail.com>
Date: Thu, 4 Mar 2021 16:29:09 -0600
From: Rob Herring <robh@...nel.org>
To: Daniel Walker <danielwa@...co.com>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
Will Deacon <will@...nel.org>,
Daniel Gimpelevich <daniel@...pelevich.san-francisco.ca.us>,
Andrew Morton <akpm@...ux-foundation.org>,
X86 ML <x86@...nel.org>,
"open list:MIPS" <linux-mips@...r.kernel.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Frank Rowand <frowand.list@...il.com>,
xe-linux-external@...co.com,
Ruslan Ruslichenko <rruslich@...co.com>,
devicetree@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/5] CMDLINE: drivers: of: ifdef out cmdline section
On Thu, Mar 4, 2021 at 3:24 PM Daniel Walker <danielwa@...co.com> wrote:
>
> On Thu, Mar 04, 2021 at 08:09:52AM +0100, Christophe Leroy wrote:
> >
> >
> > Le 04/03/2021 à 05:47, Daniel Walker a écrit :
> > > 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@...co.com
> > > Signed-off-by: Ruslan Ruslichenko <rruslich@...co.com>
> > > Signed-off-by: Daniel Walker <danielwa@...co.com>
> > > ---
> > > drivers/of/fdt.c | 12 ++++++++++++
> > > 1 file changed, 12 insertions(+)
> > >
> > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> > > index feb0f2d67fc5..cfe4f8d3c9f5 100644
> > > --- a/drivers/of/fdt.c
> > > +++ b/drivers/of/fdt.c
> > > @@ -25,6 +25,7 @@
> > > #include <linux/serial_core.h>
> > > #include <linux/sysfs.h>
> > > #include <linux/random.h>
> > > +#include <linux/cmdline.h>
> > > #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
> > > #include <asm/page.h>
> > > @@ -1048,8 +1049,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
> > > early_init_dt_check_for_initrd(node);
> > > +#ifdef CONFIG_GENERIC_CMDLINE
> > > /* Retrieve command line */
> > > p = of_get_flat_dt_prop(node, "bootargs", &l);
> > > +
> > > + /*
> > > + * The builtin command line will be added here, or it can override
> > > + * with the DT bootargs.
> > > + */
> > > + cmdline_add_builtin(data,
> > > + ((p != NULL && l > 0) ? p : NULL), /* This is sanity checking */
> >
> > Can we do more simple ? If p is NULL, p is already NULL, so (l > 0 ? p : NULL) should be enough.
>
>
> I believe Rob gave me this line. Maybe he can comment on it.
It's an obvious improvement and LGTM.
Powered by blists - more mailing lists