2019-05-07 04:49:41

by Doug Anderson

[permalink] [raw]
Subject: [PATCH] of: Add dummy for of_node_is_root if not CONFIG_OF

We'll add a dummy to just return false.

Signed-off-by: Douglas Anderson <[email protected]>
---

include/linux/of.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/linux/of.h b/include/linux/of.h
index 0cf857012f11..62ae5c1cafa5 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -653,6 +653,11 @@ static inline bool of_have_populated_dt(void)
return false;
}

+static inline bool of_node_is_root(const struct device_node *node)
+{
+ return false;
+}
+
static inline struct device_node *of_get_compatible_child(const struct device_node *parent,
const char *compatible)
{
--
2.21.0.1020.gf2820cf01a-goog


2019-05-07 14:54:13

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] of: Add dummy for of_node_is_root if not CONFIG_OF

On Mon, May 6, 2019 at 9:48 PM Douglas Anderson <[email protected]> wrote:
>
> We'll add a dummy to just return false.
>
> Signed-off-by: Douglas Anderson <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
>
> include/linux/of.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 0cf857012f11..62ae5c1cafa5 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -653,6 +653,11 @@ static inline bool of_have_populated_dt(void)
> return false;
> }
>
> +static inline bool of_node_is_root(const struct device_node *node)
> +{
> + return false;
> +}
> +
> static inline struct device_node *of_get_compatible_child(const struct device_node *parent,
> const char *compatible)
> {
> --
> 2.21.0.1020.gf2820cf01a-goog
>

2019-05-07 17:53:37

by Frank Rowand

[permalink] [raw]
Subject: Re: [PATCH] of: Add dummy for of_node_is_root if not CONFIG_OF

On 5/6/19 9:48 PM, Douglas Anderson wrote:
> We'll add a dummy to just return false.

A more complete explanation of why this is needed please.

My one guess would be compile testing of arch/sparc/kernel/prom_64.c
fails???

-Frank


>
> Signed-off-by: Douglas Anderson <[email protected]>
> ---
>
> include/linux/of.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 0cf857012f11..62ae5c1cafa5 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -653,6 +653,11 @@ static inline bool of_have_populated_dt(void)
> return false;
> }
>
> +static inline bool of_node_is_root(const struct device_node *node)
> +{
> + return false;
> +}
> +
> static inline struct device_node *of_get_compatible_child(const struct device_node *parent,
> const char *compatible)
> {
>

2019-05-07 18:01:08

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH] of: Add dummy for of_node_is_root if not CONFIG_OF

Hi,


On Tue, May 7, 2019 at 10:52 AM Frank Rowand <[email protected]> wrote:
>
> On 5/6/19 9:48 PM, Douglas Anderson wrote:
> > We'll add a dummy to just return false.
>
> A more complete explanation of why this is needed please.
>
> My one guess would be compile testing of arch/sparc/kernel/prom_64.c
> fails???

Ah, sorry. Needed for:

https://lkml.kernel.org/r/CAD=FV=Vxp-U7mZUNmAAOja5pt-8rZqPryEvwTg_Dv3ChuH_TrA@mail.gmail.com



-Doug

2019-05-07 21:52:34

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH] of: Add dummy for of_node_is_root if not CONFIG_OF

On Tue, May 7, 2019 at 10:59 AM Doug Anderson <[email protected]> wrote:
> On Tue, May 7, 2019 at 10:52 AM Frank Rowand <[email protected]> wrote:
> >
> > On 5/6/19 9:48 PM, Douglas Anderson wrote:
> > > We'll add a dummy to just return false.
> >
> > A more complete explanation of why this is needed please.
> >
> > My one guess would be compile testing of arch/sparc/kernel/prom_64.c
> > fails???
>
> Ah, sorry. Needed for:
>
> https://lkml.kernel.org/r/CAD=FV=Vxp-U7mZUNmAAOja5pt-8rZqPryEvwTg_Dv3ChuH_TrA@mail.gmail.com

Should I take both patches via pstore, or should both go via DT tree?

--
Kees Cook

2019-05-07 22:19:54

by Frank Rowand

[permalink] [raw]
Subject: Re: [PATCH] of: Add dummy for of_node_is_root if not CONFIG_OF

On 5/7/19 10:59 AM, Doug Anderson wrote:
> Hi,
>
>
> On Tue, May 7, 2019 at 10:52 AM Frank Rowand <[email protected]> wrote:
>>
>> On 5/6/19 9:48 PM, Douglas Anderson wrote:
>>> We'll add a dummy to just return false.
>>
>> A more complete explanation of why this is needed please.
>>
>> My one guess would be compile testing of arch/sparc/kernel/prom_64.c
>> fails???
>
> Ah, sorry. Needed for:
>
> https://lkml.kernel.org/r/CAD=FV=Vxp-U7mZUNmAAOja5pt-8rZqPryEvwTg_Dv3ChuH_TrA@mail.gmail.com

Got it. I went and looked at that. I think a better approach would be to
check parent node not "/reserved-memory". I am making this suggestion in
that email thread.

-Frank

>
>
>
> -Doug
> .
>

2019-05-08 15:52:40

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH] of: Add dummy for of_node_is_root if not CONFIG_OF

Hi,

On Tue, May 7, 2019 at 3:17 PM Frank Rowand <[email protected]> wrote:
>
> On 5/7/19 10:59 AM, Doug Anderson wrote:
> > Hi,
> >
> >
> > On Tue, May 7, 2019 at 10:52 AM Frank Rowand <[email protected]> wrote:
> >>
> >> On 5/6/19 9:48 PM, Douglas Anderson wrote:
> >>> We'll add a dummy to just return false.
> >>
> >> A more complete explanation of why this is needed please.
> >>
> >> My one guess would be compile testing of arch/sparc/kernel/prom_64.c
> >> fails???
> >
> > Ah, sorry. Needed for:
> >
> > https://lkml.kernel.org/r/CAD=FV=Vxp-U7mZUNmAAOja5pt-8rZqPryEvwTg_Dv3ChuH_TrA@mail.gmail.com
>
> Got it. I went and looked at that. I think a better approach would be to
> check parent node not "/reserved-memory". I am making this suggestion in
> that email thread.

OK. Assuming that people are happy with that approach [1], we should
consider this patch abandoned. Thanks for your reviews!

[1] https://lkml.kernel.org/r/[email protected]

-Doug