Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7c360ee authored by Wei Yongjun's avatar Wei Yongjun Committed by Benjamin Herrenschmidt
Browse files

powerpc/windfarm: Use for_each_node_by_type() macro



Use for_each_node_by_type() macro instead of open coding it.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent e253ebab
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -681,7 +681,7 @@ static int __init wf_pm112_init(void)


	/* Count the number of CPU cores */
	/* Count the number of CPU cores */
	nr_cores = 0;
	nr_cores = 0;
	for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; )
	for_each_node_by_type(cpu, "cpu")
		++nr_cores;
		++nr_cores;


	printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n");
	printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n");
+1 −1
Original line number Original line Diff line number Diff line
@@ -804,7 +804,7 @@ static int __init wf_pm72_init(void)


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


	/* Count the number of CPU cores */
	/* Count the number of CPU cores */
	nr_chips = 0;
	nr_chips = 0;
	for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; )
	for_each_node_by_type(cpu, "cpu")
		++nr_chips;
		++nr_chips;
	if (nr_chips > NR_CHIPS)
	if (nr_chips > NR_CHIPS)
		nr_chips = NR_CHIPS;
		nr_chips = NR_CHIPS;