瀏覽代碼

powerpc/windfarm: Use for_each_node_by_type() macro

Use for_each_node_by_type() macro instead of open coding it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Wei Yongjun 12 年之前
父節點
當前提交
c7c360eedb
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      drivers/macintosh/windfarm_pm112.c
  2. 1 1
      drivers/macintosh/windfarm_pm72.c
  3. 1 1
      drivers/macintosh/windfarm_rm31.c

+ 1 - 1
drivers/macintosh/windfarm_pm112.c

@@ -681,7 +681,7 @@ static int __init wf_pm112_init(void)
 
 	/* Count the number of CPU cores */
 	nr_cores = 0;
-	for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; )
+	for_each_node_by_type(cpu, "cpu")
 		++nr_cores;
 
 	printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n");

+ 1 - 1
drivers/macintosh/windfarm_pm72.c

@@ -804,7 +804,7 @@ static int __init wf_pm72_init(void)
 
 	/* Count the number of CPU cores */
 	nr_chips = 0;
-	for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; )
+	for_each_node_by_type(cpu, "cpu")
 		++nr_chips;
 	if (nr_chips > NR_CHIPS)
 		nr_chips = NR_CHIPS;

+ 1 - 1
drivers/macintosh/windfarm_rm31.c

@@ -696,7 +696,7 @@ static int __init wf_rm31_init(void)
 
 	/* Count the number of CPU cores */
 	nr_chips = 0;
-	for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; )
+	for_each_node_by_type(cpu, "cpu")
 		++nr_chips;
 	if (nr_chips > NR_CHIPS)
 		nr_chips = NR_CHIPS;