aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-08-10 16:44:23 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-09-20 01:53:23 -0400
commitdfbe93a222e74b6f96ad84eff2b04a0f864fac65 (patch)
tree6ce5719fc890a57f143f17949c90f4629882a9e9 /arch/powerpc
parent94db7c5e14f44b943febe54e089d077cd983d284 (diff)
powerpc: Coding style cleanups
While converting code to use for_each_node_by_type I noticed a number of coding style issues. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/setup_64.c20
-rw-r--r--arch/powerpc/mm/numa.c7
2 files changed, 17 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index eade1fd8ee2e..d4168c93098f 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -281,11 +281,11 @@ static void __init initialize_cache_info(void)
281 for_each_node_by_type(np, "cpu") { 281 for_each_node_by_type(np, "cpu") {
282 num_cpus += 1; 282 num_cpus += 1;
283 283
284 /* We're assuming *all* of the CPUs have the same 284 /*
285 * We're assuming *all* of the CPUs have the same
285 * d-cache and i-cache sizes... -Peter 286 * d-cache and i-cache sizes... -Peter
286 */ 287 */
287 288 if (num_cpus == 1) {
288 if ( num_cpus == 1 ) {
289 const u32 *sizep, *lsizep; 289 const u32 *sizep, *lsizep;
290 u32 size, lsize; 290 u32 size, lsize;
291 291
@@ -294,10 +294,13 @@ static void __init initialize_cache_info(void)
294 sizep = of_get_property(np, "d-cache-size", NULL); 294 sizep = of_get_property(np, "d-cache-size", NULL);
295 if (sizep != NULL) 295 if (sizep != NULL)
296 size = *sizep; 296 size = *sizep;
297 lsizep = of_get_property(np, "d-cache-block-size", NULL); 297 lsizep = of_get_property(np, "d-cache-block-size",
298 NULL);
298 /* fallback if block size missing */ 299 /* fallback if block size missing */
299 if (lsizep == NULL) 300 if (lsizep == NULL)
300 lsizep = of_get_property(np, "d-cache-line-size", NULL); 301 lsizep = of_get_property(np,
302 "d-cache-line-size",
303 NULL);
301 if (lsizep != NULL) 304 if (lsizep != NULL)
302 lsize = *lsizep; 305 lsize = *lsizep;
303 if (sizep == 0 || lsizep == 0) 306 if (sizep == 0 || lsizep == 0)
@@ -314,9 +317,12 @@ static void __init initialize_cache_info(void)
314 sizep = of_get_property(np, "i-cache-size", NULL); 317 sizep = of_get_property(np, "i-cache-size", NULL);
315 if (sizep != NULL) 318 if (sizep != NULL)
316 size = *sizep; 319 size = *sizep;
317 lsizep = of_get_property(np, "i-cache-block-size", NULL); 320 lsizep = of_get_property(np, "i-cache-block-size",
321 NULL);
318 if (lsizep == NULL) 322 if (lsizep == NULL)
319 lsizep = of_get_property(np, "i-cache-line-size", NULL); 323 lsizep = of_get_property(np,
324 "i-cache-line-size",
325 NULL);
320 if (lsizep != NULL) 326 if (lsizep != NULL)
321 lsize = *lsizep; 327 lsize = *lsizep;
322 if (sizep == 0 || lsizep == 0) 328 if (sizep == 0 || lsizep == 0)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 00cc090cd1dc..0bfb90c50571 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -709,7 +709,6 @@ static void __init parse_drconf_memory(struct device_node *memory)
709 709
710static int __init parse_numa_properties(void) 710static int __init parse_numa_properties(void)
711{ 711{
712 struct device_node *cpu = NULL;
713 struct device_node *memory; 712 struct device_node *memory;
714 int default_nid = 0; 713 int default_nid = 0;
715 unsigned long i; 714 unsigned long i;
@@ -732,6 +731,7 @@ static int __init parse_numa_properties(void)
732 * each node to be onlined must have NODE_DATA etc backing it. 731 * each node to be onlined must have NODE_DATA etc backing it.
733 */ 732 */
734 for_each_present_cpu(i) { 733 for_each_present_cpu(i) {
734 struct device_node *cpu;
735 int nid; 735 int nid;
736 736
737 cpu = of_get_cpu_node(i, NULL); 737 cpu = of_get_cpu_node(i, NULL);
@@ -800,8 +800,9 @@ new_range:
800 } 800 }
801 801
802 /* 802 /*
803 * Now do the same thing for each MEMBLOCK listed in the ibm,dynamic-memory 803 * Now do the same thing for each MEMBLOCK listed in the
804 * property in the ibm,dynamic-reconfiguration-memory node. 804 * ibm,dynamic-memory property in the
805 * ibm,dynamic-reconfiguration-memory node.
805 */ 806 */
806 memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); 807 memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
807 if (memory) 808 if (memory)