diff options
author | Anton Blanchard <anton@samba.org> | 2011-08-10 16:44:22 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-09-20 01:53:23 -0400 |
commit | 94db7c5e14f44b943febe54e089d077cd983d284 (patch) | |
tree | 1dc71fe4ee73a58209c3a60bcd3913fae25c463b /arch/powerpc/mm | |
parent | 6083184269fd723affca4f6340e491950267622a (diff) |
powerpc: Use for_each_node_by_type instead of open coding it
Use for_each_node_by_type instead of open coding it.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/numa.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 2c1ae7a5fb53..00cc090cd1dc 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -710,7 +710,7 @@ static void __init parse_drconf_memory(struct device_node *memory) | |||
710 | static int __init parse_numa_properties(void) | 710 | static int __init parse_numa_properties(void) |
711 | { | 711 | { |
712 | struct device_node *cpu = NULL; | 712 | struct device_node *cpu = NULL; |
713 | struct device_node *memory = NULL; | 713 | struct device_node *memory; |
714 | int default_nid = 0; | 714 | int default_nid = 0; |
715 | unsigned long i; | 715 | unsigned long i; |
716 | 716 | ||
@@ -750,8 +750,8 @@ static int __init parse_numa_properties(void) | |||
750 | } | 750 | } |
751 | 751 | ||
752 | get_n_mem_cells(&n_mem_addr_cells, &n_mem_size_cells); | 752 | get_n_mem_cells(&n_mem_addr_cells, &n_mem_size_cells); |
753 | memory = NULL; | 753 | |
754 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { | 754 | for_each_node_by_type(memory, "memory") { |
755 | unsigned long start; | 755 | unsigned long start; |
756 | unsigned long size; | 756 | unsigned long size; |
757 | int nid; | 757 | int nid; |
@@ -1187,10 +1187,10 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory, | |||
1187 | */ | 1187 | */ |
1188 | int hot_add_node_scn_to_nid(unsigned long scn_addr) | 1188 | int hot_add_node_scn_to_nid(unsigned long scn_addr) |
1189 | { | 1189 | { |
1190 | struct device_node *memory = NULL; | 1190 | struct device_node *memory; |
1191 | int nid = -1; | 1191 | int nid = -1; |
1192 | 1192 | ||
1193 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { | 1193 | for_each_node_by_type(memory, "memory") { |
1194 | unsigned long start, size; | 1194 | unsigned long start, size; |
1195 | int ranges; | 1195 | int ranges; |
1196 | const unsigned int *memcell_buf; | 1196 | const unsigned int *memcell_buf; |