diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-12-01 22:00:09 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-01-10 01:00:36 -0500 |
commit | c7c360eedb8c1eea302a224a8c83d19a4e4cf608 (patch) | |
tree | cb979c49278a8ede23a411be75fd3bd4df7369ab /drivers/macintosh | |
parent | e253ebab935693cc2eafbc93e94b68b47dc779db (diff) |
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>
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/windfarm_pm112.c | 2 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_pm72.c | 2 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_rm31.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c index 35ef6e2582b8..3024685e4cca 100644 --- a/drivers/macintosh/windfarm_pm112.c +++ b/drivers/macintosh/windfarm_pm112.c | |||
@@ -681,7 +681,7 @@ static int __init wf_pm112_init(void) | |||
681 | 681 | ||
682 | /* Count the number of CPU cores */ | 682 | /* Count the number of CPU cores */ |
683 | nr_cores = 0; | 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 | ++nr_cores; | 685 | ++nr_cores; |
686 | 686 | ||
687 | printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n"); | 687 | printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n"); |
diff --git a/drivers/macintosh/windfarm_pm72.c b/drivers/macintosh/windfarm_pm72.c index 6e5585357cd3..2f506b9d5a52 100644 --- a/drivers/macintosh/windfarm_pm72.c +++ b/drivers/macintosh/windfarm_pm72.c | |||
@@ -804,7 +804,7 @@ static int __init wf_pm72_init(void) | |||
804 | 804 | ||
805 | /* Count the number of CPU cores */ | 805 | /* Count the number of CPU cores */ |
806 | nr_chips = 0; | 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 | ++nr_chips; | 808 | ++nr_chips; |
809 | if (nr_chips > NR_CHIPS) | 809 | if (nr_chips > NR_CHIPS) |
810 | nr_chips = NR_CHIPS; | 810 | nr_chips = NR_CHIPS; |
diff --git a/drivers/macintosh/windfarm_rm31.c b/drivers/macintosh/windfarm_rm31.c index 844003fb4ef0..0b9a79b2f48a 100644 --- a/drivers/macintosh/windfarm_rm31.c +++ b/drivers/macintosh/windfarm_rm31.c | |||
@@ -696,7 +696,7 @@ static int __init wf_rm31_init(void) | |||
696 | 696 | ||
697 | /* Count the number of CPU cores */ | 697 | /* Count the number of CPU cores */ |
698 | nr_chips = 0; | 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 | ++nr_chips; | 700 | ++nr_chips; |
701 | if (nr_chips > NR_CHIPS) | 701 | if (nr_chips > NR_CHIPS) |
702 | nr_chips = NR_CHIPS; | 702 | nr_chips = NR_CHIPS; |