From: Jeremy Linton <jeremy.linton@arm.com>
To: Emil Renner Berthing <emil.renner.berthing@canonical.com>,
linux-riscv@lists.infradead.org
Cc: "Steffen Persvold" <spersvold@gmail.com>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
linux-kernel@vger.kernel.org,
"Yunhui Cui" <cuiyunhui@bytedance.com>,
"Conor Dooley" <conor.dooley@microchip.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Sudeep Holla" <sudeep.holla@arm.com>,
"Miquel Sabaté Solà" <mikisabate@gmail.com>
Subject: Re: [PATCH v1] riscv: Use of_property_present() to test for non-boolean properties
Date: Wed, 5 Feb 2025 17:23:26 -0600 [thread overview]
Message-ID: <86bee3f3-acf3-4b3e-ad9c-e7d021355214@arm.com> (raw)
In-Reply-To: <20250205143903.413959-1-emil.renner.berthing@canonical.com>
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
next prev parent reply other threads:[~2025-02-05 23:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2025-02-11 7:55 ` Alexandre Ghiti
2025-02-11 9:20 ` Emil Renner Berthing
2025-02-13 14:20 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86bee3f3-acf3-4b3e-ad9c-e7d021355214@arm.com \
--to=jeremy.linton@arm.com \
--cc=conor.dooley@microchip.com \
--cc=cuiyunhui@bytedance.com \
--cc=emil.renner.berthing@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mikisabate@gmail.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=spersvold@gmail.com \
--cc=sudeep.holla@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox