aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup-common.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2006-07-12 01:35:54 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-31 01:55:04 -0400
commita7f67bdf2c9f24509b8e81e0f35573b611987c80 (patch)
tree201662dd6504418ef3c84cfe1f280153a4d8cb29 /arch/powerpc/kernel/setup-common.c
parent4288b92b9644fdb4c6168273873fe08f32090d7a (diff)
[POWERPC] Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its return value. Also, treat the return value as const, so we can constify get_property later. powerpc core changes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r--arch/powerpc/kernel/setup-common.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index c6d7b98af7d5..aaf1727b3570 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -304,16 +304,15 @@ struct seq_operations cpuinfo_op = {
304void __init check_for_initrd(void) 304void __init check_for_initrd(void)
305{ 305{
306#ifdef CONFIG_BLK_DEV_INITRD 306#ifdef CONFIG_BLK_DEV_INITRD
307 unsigned long *prop; 307 const unsigned long *prop;
308 308
309 DBG(" -> check_for_initrd()\n"); 309 DBG(" -> check_for_initrd()\n");
310 310
311 if (of_chosen) { 311 if (of_chosen) {
312 prop = (unsigned long *)get_property(of_chosen, 312 prop = get_property(of_chosen, "linux,initrd-start", NULL);
313 "linux,initrd-start", NULL);
314 if (prop != NULL) { 313 if (prop != NULL) {
315 initrd_start = (unsigned long)__va(*prop); 314 initrd_start = (unsigned long)__va(*prop);
316 prop = (unsigned long *)get_property(of_chosen, 315 prop = get_property(of_chosen,
317 "linux,initrd-end", NULL); 316 "linux,initrd-end", NULL);
318 if (prop != NULL) { 317 if (prop != NULL) {
319 initrd_end = (unsigned long)__va(*prop); 318 initrd_end = (unsigned long)__va(*prop);
@@ -366,15 +365,14 @@ void __init smp_setup_cpu_maps(void)
366 int cpu = 0; 365 int cpu = 0;
367 366
368 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { 367 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
369 int *intserv; 368 const int *intserv;
370 int j, len = sizeof(u32), nthreads = 1; 369 int j, len = sizeof(u32), nthreads = 1;
371 370
372 intserv = (int *)get_property(dn, "ibm,ppc-interrupt-server#s", 371 intserv = get_property(dn, "ibm,ppc-interrupt-server#s", &len);
373 &len);
374 if (intserv) 372 if (intserv)
375 nthreads = len / sizeof(int); 373 nthreads = len / sizeof(int);
376 else { 374 else {
377 intserv = (int *) get_property(dn, "reg", NULL); 375 intserv = get_property(dn, "reg", NULL);
378 if (!intserv) 376 if (!intserv)
379 intserv = &cpu; /* assume logical == phys */ 377 intserv = &cpu; /* assume logical == phys */
380 } 378 }
@@ -395,13 +393,12 @@ void __init smp_setup_cpu_maps(void)
395 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && 393 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) &&
396 (dn = of_find_node_by_path("/rtas"))) { 394 (dn = of_find_node_by_path("/rtas"))) {
397 int num_addr_cell, num_size_cell, maxcpus; 395 int num_addr_cell, num_size_cell, maxcpus;
398 unsigned int *ireg; 396 const unsigned int *ireg;
399 397
400 num_addr_cell = prom_n_addr_cells(dn); 398 num_addr_cell = prom_n_addr_cells(dn);
401 num_size_cell = prom_n_size_cells(dn); 399 num_size_cell = prom_n_size_cells(dn);
402 400
403 ireg = (unsigned int *) 401 ireg = get_property(dn, "ibm,lrdr-capacity", NULL);
404 get_property(dn, "ibm,lrdr-capacity", NULL);
405 402
406 if (!ireg) 403 if (!ireg)
407 goto out; 404 goto out;