[PATCH] for_each_possible_cpu: powerpc
[safe/jmp/linux-2.6] / arch / powerpc / kernel / lparcfg.c
index 1ae96a8..1b73508 100644 (file)
@@ -56,7 +56,7 @@ static unsigned long get_purr(void)
        unsigned long sum_purr = 0;
        int cpu;
 
-       for_each_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                sum_purr += lppaca[cpu].emulated_time_base;
 
 #ifdef PURR_DEBUG
@@ -222,7 +222,7 @@ static unsigned long get_purr(void)
        int cpu;
        struct cpu_usage *cu;
 
-       for_each_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                cu = &per_cpu(cpu_usage_array, cpu);
                sum_purr += cu->current_tb;
        }
@@ -341,7 +341,7 @@ static int lparcfg_data(struct seq_file *m, void *v)
        const char *system_id = "";
        unsigned int *lp_index_ptr, lp_index = 0;
        struct device_node *rtas_node;
-       int *lrdrp;
+       int *lrdrp = NULL;
 
        rootdn = find_path_device("/");
        if (rootdn) {
@@ -362,7 +362,9 @@ static int lparcfg_data(struct seq_file *m, void *v)
        seq_printf(m, "partition_id=%d\n", (int)lp_index);
 
        rtas_node = find_path_device("/rtas");
-       lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL);
+       if (rtas_node)
+               lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity",
+                                           NULL);
 
        if (lrdrp == NULL) {
                partition_potential_processors = vdso_data->processorCount;