Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Benjamin Herrenschmidt
c7c360ee e253ebab

+3 -3
+1 -1
drivers/macintosh/windfarm_pm112.c
··· 681 681 682 682 /* Count the number of CPU cores */ 683 683 nr_cores = 0; 684 - for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; ) 684 + for_each_node_by_type(cpu, "cpu") 685 685 ++nr_cores; 686 686 687 687 printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n");
+1 -1
drivers/macintosh/windfarm_pm72.c
··· 804 804 805 805 /* Count the number of CPU cores */ 806 806 nr_chips = 0; 807 - for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; ) 807 + for_each_node_by_type(cpu, "cpu") 808 808 ++nr_chips; 809 809 if (nr_chips > NR_CHIPS) 810 810 nr_chips = NR_CHIPS;
+1 -1
drivers/macintosh/windfarm_rm31.c
··· 696 696 697 697 /* Count the number of CPU cores */ 698 698 nr_chips = 0; 699 - for (cpu = NULL; (cpu = of_find_node_by_type(cpu, "cpu")) != NULL; ) 699 + for_each_node_by_type(cpu, "cpu") 700 700 ++nr_chips; 701 701 if (nr_chips > NR_CHIPS) 702 702 nr_chips = NR_CHIPS;