[PATCH -next] ARM: uniphier: use for_each_matching_node() macro

Qinglang Miao miaoqinglang at huawei.com
Mon Jul 27 22:25:42 EDT 2020


Use for_each_matching_node() macro instead of open coding it.

Signed-off-by: Qinglang Miao <miaoqinglang at huawei.com>
---
 arch/arm/mm/cache-uniphier.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/cache-uniphier.c b/arch/arm/mm/cache-uniphier.c
index ff2881458..112f19cb3 100644
--- a/arch/arm/mm/cache-uniphier.c
+++ b/arch/arm/mm/cache-uniphier.c
@@ -450,12 +450,12 @@ static int __init __uniphier_cache_init(struct device_node *np,
 
 int __init uniphier_cache_init(void)
 {
-	struct device_node *np = NULL;
+	struct device_node *np;
 	unsigned int cache_level;
 	int ret = 0;
 
 	/* look for level 2 cache */
-	while ((np = of_find_matching_node(np, uniphier_cache_match)))
+	for_each_matching_node(np, uniphier_cache_match)
 		if (!of_property_read_u32(np, "cache-level", &cache_level) &&
 		    cache_level == 2)
 			break;
-- 
2.25.1




More information about the linux-arm-kernel mailing list