* [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties
@ 2025-02-05 14:39 Emil Renner Berthing
2025-02-05 19:47 ` Ron Economos
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Emil Renner Berthing @ 2025-02-05 14:39 UTC (permalink / raw)
To: linux-riscv
Cc: Steffen Persvold, Paul Walmsley, linux-kernel, Jeremy Linton,
Conor Dooley, Palmer Dabbelt, Yunhui Cui, Sudeep Holla,
Miquel Sabaté Solà
The use of of_property_read_bool() for non-boolean properties is
deprecated and since
commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
a warning is displayed when used incorrectly. Fix it by switching to
of_property_present() as recommended in the same commit.
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
---
arch/riscv/kernel/cacheinfo.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
index 2d40736fc37c..26b085dbdd07 100644
--- a/arch/riscv/kernel/cacheinfo.c
+++ b/arch/riscv/kernel/cacheinfo.c
@@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cpu)
if (!np)
return -ENOENT;
- if (of_property_read_bool(np, "cache-size"))
+ if (of_property_present(np, "cache-size"))
ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
- if (of_property_read_bool(np, "i-cache-size"))
+ if (of_property_present(np, "i-cache-size"))
ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
- if (of_property_read_bool(np, "d-cache-size"))
+ if (of_property_present(np, "d-cache-size"))
ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
prev = np;
@@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cpu)
break;
if (level <= levels)
break;
- if (of_property_read_bool(np, "cache-size"))
+ if (of_property_present(np, "cache-size"))
ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
- if (of_property_read_bool(np, "i-cache-size"))
+ if (of_property_present(np, "i-cache-size"))
ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
- if (of_property_read_bool(np, "d-cache-size"))
+ if (of_property_present(np, "d-cache-size"))
ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
levels = level;
}
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties
2025-02-05 14:39 [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties Emil Renner Berthing
@ 2025-02-05 19:47 ` Ron Economos
2025-02-05 23:23 ` Jeremy Linton
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Ron Economos @ 2025-02-05 19:47 UTC (permalink / raw)
To: Emil Renner Berthing, linux-riscv
Cc: Steffen Persvold, Paul Walmsley, linux-kernel, Jeremy Linton,
Conor Dooley, Palmer Dabbelt, Yunhui Cui, Sudeep Holla,
Miquel Sabaté Solà
On 2/5/25 06:39, Emil Renner Berthing wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated and since
>
> commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
>
> a warning is displayed when used incorrectly. Fix it by switching to
> of_property_present() as recommended in the same commit.
>
> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> ---
> arch/riscv/kernel/cacheinfo.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
> index 2d40736fc37c..26b085dbdd07 100644
> --- a/arch/riscv/kernel/cacheinfo.c
> +++ b/arch/riscv/kernel/cacheinfo.c
> @@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cpu)
> if (!np)
> return -ENOENT;
>
> - if (of_property_read_bool(np, "cache-size"))
> + if (of_property_present(np, "cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> - if (of_property_read_bool(np, "i-cache-size"))
> + if (of_property_present(np, "i-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> - if (of_property_read_bool(np, "d-cache-size"))
> + if (of_property_present(np, "d-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
>
> prev = np;
> @@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cpu)
> break;
> if (level <= levels)
> break;
> - if (of_property_read_bool(np, "cache-size"))
> + if (of_property_present(np, "cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> - if (of_property_read_bool(np, "i-cache-size"))
> + if (of_property_present(np, "i-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> - if (of_property_read_bool(np, "d-cache-size"))
> + if (of_property_present(np, "d-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
> levels = level;
> }
Works good on VisionFive 2 and Unmatched.
Tested-by: Ron Economos <re@w6rz.net>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties
2025-02-05 14:39 [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties Emil Renner Berthing
2025-02-05 19:47 ` Ron Economos
@ 2025-02-05 23:23 ` Jeremy Linton
2025-02-11 7:55 ` Alexandre Ghiti
2025-02-13 14:20 ` patchwork-bot+linux-riscv
3 siblings, 0 replies; 6+ messages in thread
From: Jeremy Linton @ 2025-02-05 23:23 UTC (permalink / raw)
To: Emil Renner Berthing, linux-riscv
Cc: Steffen Persvold, Paul Walmsley, linux-kernel, Yunhui Cui,
Conor Dooley, Palmer Dabbelt, Sudeep Holla,
Miquel Sabaté Solà
On 2/5/25 8:39 AM, Emil Renner Berthing wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated and since
>
> commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
>
> a warning is displayed when used incorrectly. Fix it by switching to
> of_property_present() as recommended in the same commit.
>
> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> ---
> arch/riscv/kernel/cacheinfo.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
> index 2d40736fc37c..26b085dbdd07 100644
> --- a/arch/riscv/kernel/cacheinfo.c
> +++ b/arch/riscv/kernel/cacheinfo.c
> @@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cpu)
> if (!np)
> return -ENOENT;
>
> - if (of_property_read_bool(np, "cache-size"))
> + if (of_property_present(np, "cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> - if (of_property_read_bool(np, "i-cache-size"))
> + if (of_property_present(np, "i-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> - if (of_property_read_bool(np, "d-cache-size"))
> + if (of_property_present(np, "d-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
>
> prev = np;
> @@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cpu)
> break;
> if (level <= levels)
> break;
> - if (of_property_read_bool(np, "cache-size"))
> + if (of_property_present(np, "cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> - if (of_property_read_bool(np, "i-cache-size"))
> + if (of_property_present(np, "i-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> - if (of_property_read_bool(np, "d-cache-size"))
> + if (of_property_present(np, "d-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
> levels = level;
> }
This looks sane to me:
Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties
2025-02-05 14:39 [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties Emil Renner Berthing
2025-02-05 19:47 ` Ron Economos
2025-02-05 23:23 ` Jeremy Linton
@ 2025-02-11 7:55 ` Alexandre Ghiti
2025-02-11 9:20 ` Emil Renner Berthing
2025-02-13 14:20 ` patchwork-bot+linux-riscv
3 siblings, 1 reply; 6+ messages in thread
From: Alexandre Ghiti @ 2025-02-11 7:55 UTC (permalink / raw)
To: Emil Renner Berthing, linux-riscv
Cc: Steffen Persvold, Paul Walmsley, linux-kernel, Jeremy Linton,
Conor Dooley, Palmer Dabbelt, Yunhui Cui, Sudeep Holla,
Miquel Sabaté Solà, Rob Herring
Hi Emil,
On 05/02/2025 15:39, Emil Renner Berthing wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated and since
>
> commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
>
> a warning is displayed when used incorrectly. Fix it by switching to
> of_property_present() as recommended in the same commit.
>
> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> ---
> arch/riscv/kernel/cacheinfo.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
> index 2d40736fc37c..26b085dbdd07 100644
> --- a/arch/riscv/kernel/cacheinfo.c
> +++ b/arch/riscv/kernel/cacheinfo.c
> @@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cpu)
> if (!np)
> return -ENOENT;
>
> - if (of_property_read_bool(np, "cache-size"))
> + if (of_property_present(np, "cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> - if (of_property_read_bool(np, "i-cache-size"))
> + if (of_property_present(np, "i-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> - if (of_property_read_bool(np, "d-cache-size"))
> + if (of_property_present(np, "d-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
>
> prev = np;
> @@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cpu)
> break;
> if (level <= levels)
> break;
> - if (of_property_read_bool(np, "cache-size"))
> + if (of_property_present(np, "cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> - if (of_property_read_bool(np, "i-cache-size"))
> + if (of_property_present(np, "i-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> - if (of_property_read_bool(np, "d-cache-size"))
> + if (of_property_present(np, "d-cache-size"))
> ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
> levels = level;
> }
The same patch has been on the ML since last november:
https://lore.kernel.org/linux-riscv/20241104190314.270095-1-robh@kernel.org/
And was already re-sent once end of december...
Thanks anyway,
Alex
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties
2025-02-11 7:55 ` Alexandre Ghiti
@ 2025-02-11 9:20 ` Emil Renner Berthing
0 siblings, 0 replies; 6+ messages in thread
From: Emil Renner Berthing @ 2025-02-11 9:20 UTC (permalink / raw)
To: Alexandre Ghiti, Emil Renner Berthing, linux-riscv
Cc: Steffen Persvold, Paul Walmsley, linux-kernel, Jeremy Linton,
Conor Dooley, Palmer Dabbelt, Yunhui Cui, Sudeep Holla,
Miquel Sabaté Solà, Rob Herring
Alexandre Ghiti wrote:
> Hi Emil,
>
> On 05/02/2025 15:39, Emil Renner Berthing wrote:
> > The use of of_property_read_bool() for non-boolean properties is
> > deprecated and since
> >
> > commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
> >
> > a warning is displayed when used incorrectly. Fix it by switching to
> > of_property_present() as recommended in the same commit.
> >
> > Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> > ---
> > arch/riscv/kernel/cacheinfo.c | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
> > index 2d40736fc37c..26b085dbdd07 100644
> > --- a/arch/riscv/kernel/cacheinfo.c
> > +++ b/arch/riscv/kernel/cacheinfo.c
> > @@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cpu)
> > if (!np)
> > return -ENOENT;
> >
> > - if (of_property_read_bool(np, "cache-size"))
> > + if (of_property_present(np, "cache-size"))
> > ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> > - if (of_property_read_bool(np, "i-cache-size"))
> > + if (of_property_present(np, "i-cache-size"))
> > ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> > - if (of_property_read_bool(np, "d-cache-size"))
> > + if (of_property_present(np, "d-cache-size"))
> > ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
> >
> > prev = np;
> > @@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cpu)
> > break;
> > if (level <= levels)
> > break;
> > - if (of_property_read_bool(np, "cache-size"))
> > + if (of_property_present(np, "cache-size"))
> > ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> > - if (of_property_read_bool(np, "i-cache-size"))
> > + if (of_property_present(np, "i-cache-size"))
> > ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> > - if (of_property_read_bool(np, "d-cache-size"))
> > + if (of_property_present(np, "d-cache-size"))
> > ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
> > levels = level;
> > }
>
>
> The same patch has been on the ML since last november:
>
> https://lore.kernel.org/linux-riscv/20241104190314.270095-1-robh@kernel.org/
>
> And was already re-sent once end of december...
Yeah I saw that later, but it would still be great to have this applied in 6.14
so we don't get all those warnings at boot.
/Emil
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties
2025-02-05 14:39 [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties Emil Renner Berthing
` (2 preceding siblings ...)
2025-02-11 7:55 ` Alexandre Ghiti
@ 2025-02-13 14:20 ` patchwork-bot+linux-riscv
3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-02-13 14:20 UTC (permalink / raw)
To: Emil Renner Berthing
Cc: linux-riscv, spersvold, paul.walmsley, linux-kernel,
jeremy.linton, conor.dooley, palmer, cuiyunhui, sudeep.holla,
mikisabate
Hello:
This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Wed, 5 Feb 2025 15:39:01 +0100 you wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated and since
>
> commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
>
> a warning is displayed when used incorrectly. Fix it by switching to
> of_property_present() as recommended in the same commit.
>
> [...]
Here is the summary with links:
- [v1] riscv: Use of_property_present() to test for non-boolean properties
https://git.kernel.org/riscv/c/b9524a73725d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-02-13 15:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05 14:39 [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties Emil Renner Berthing
2025-02-05 19:47 ` Ron Economos
2025-02-05 23:23 ` Jeremy Linton
2025-02-11 7:55 ` Alexandre Ghiti
2025-02-11 9:20 ` Emil Renner Berthing
2025-02-13 14:20 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox