diff mbox series

[RESEND,v2] riscv: cacheinfo: Use of_property_present() for non-boolean properties

Message ID 20241231161400.214307-1-robh@kernel.org (mailing list archive)
State Accepted
Commit b9524a73725d337ef08da3f24c3216708dfd9c0e
Headers show
Series [RESEND,v2] riscv: cacheinfo: Use of_property_present() for non-boolean properties | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 103.73s
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1026.06s
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1207.43s
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 15.79s
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 17.45s
conchuod/patch-1-test-6 warning .github/scripts/patches/tests/checkpatch.sh took 0.39s
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 36.81s
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.47s
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.02s

Commit Message

Rob Herring (Arm) Dec. 31, 2024, 4:13 p.m. UTC
The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Reviewed-by: Clément Léger <cleger@rivosinc.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 arch/riscv/kernel/cacheinfo.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Geert Uytterhoeven Jan. 14, 2025, 10:52 a.m. UTC | #1
Hi Rob,

Thanks for your patch!

On Tue, Dec 31, 2024 at 5:14 PM Rob Herring (Arm) <robh@kernel.org> wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.

Please add

    This gets rid of the following boot warnings:

        OF: /cpus/cpu@0: Read of boolean property 'i-cache-size' with a value.
        OF: /cpus/cpu@0: Read of boolean property 'd-cache-size' with a value.
        OF: /soc/cache-controller@13400000: Read of boolean property
'cache-size' with a value.

so the next person doesn't have to dive into the code to find this patch ;-)

> Reviewed-by: Clément Léger <cleger@rivosinc.com>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Rob Herring (Arm) Jan. 14, 2025, 3:25 p.m. UTC | #2
On Tue, Jan 14, 2025 at 4:52 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Rob,
>
> Thanks for your patch!
>
> On Tue, Dec 31, 2024 at 5:14 PM Rob Herring (Arm) <robh@kernel.org> wrote:
> > The use of of_property_read_bool() for non-boolean properties is
> > deprecated in favor of of_property_present() when testing for property
> > presence.
>
> Please add
>
>     This gets rid of the following boot warnings:
>
>         OF: /cpus/cpu@0: Read of boolean property 'i-cache-size' with a value.
>         OF: /cpus/cpu@0: Read of boolean property 'd-cache-size' with a value.
>         OF: /soc/cache-controller@13400000: Read of boolean property
> 'cache-size' with a value.
>
> so the next person doesn't have to dive into the code to find this patch ;-)

If this patch had been picked up in a timely manner, no one would have
ever seen that warning. I'll leave it to the riscv maintainers to add
that if they desire. That warning didn't exist when this patch was
written.

Rob
patchwork-bot+linux-riscv@kernel.org Feb. 13, 2025, 2:20 p.m. UTC | #3
Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Tue, 31 Dec 2024 10:13:59 -0600 you wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.
> 
> Reviewed-by: Clément Léger <cleger@rivosinc.com>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> 
> [...]

Here is the summary with links:
  - [RESEND,v2] riscv: cacheinfo: Use of_property_present() for non-boolean properties
    https://git.kernel.org/riscv/c/b9524a73725d

You are awesome, thank you!
diff mbox series

Patch

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;
 	}