Skip to contentSkip to conversation

riscv: cacheinfo: Use of_property_present() for non-boolean properties

PATCH RESEND Applied Rob Herring (Arm) 3 participants 4 messages Dec 31, 2024 – Feb 13, 2025 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 riscv: cacheinfo: Use of_property_present() for non-boolean properties

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

---
 arch/riscv/kernel/cacheinfo.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/riscv/kernel/cacheinfo.c +6 -6
index 2d40736fc37c..26b085dbdd07 100644
@@ -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;
 	}
Signature · 1 line
2.45.2
Reviewed-by Tested-by on v2 1/1
#1 lore raw

Hi Rob,

Thanks for your patch!

Quoted 3 lines · Rob Herring (Arm)

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

Quoted 2 lines

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
Quoted 12 lines · Geert Uytterhoeven

Hi Rob,

Thanks for your patch!

Quoted 3 lines · Rob Herring (Arm)

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

Quoted 8 lines

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

#3 lore raw
In reply to Rob Herring (Arm)
This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <[email protected]>:

Quoted 8 lines · 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.

[...]

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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html