linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / i386 / oprofile / nmi_int.c
index ec0fd3c..0493e8b 100644 (file)
@@ -122,7 +122,7 @@ static void nmi_save_registers(void * dummy)
 static void free_msrs(void)
 {
        int i;
-       for_each_possible_cpu(i) {
+       for (i = 0; i < NR_CPUS; ++i) {
                kfree(cpu_msrs[i].counters);
                cpu_msrs[i].counters = NULL;
                kfree(cpu_msrs[i].controls);
@@ -138,7 +138,10 @@ static int allocate_msrs(void)
        size_t counters_size = sizeof(struct op_msr) * model->num_counters;
 
        int i;
-       for_each_online_cpu(i) {
+       for (i = 0; i < NR_CPUS; ++i) {
+               if (!cpu_online(i))
+                       continue;
+
                cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL);
                if (!cpu_msrs[i].counters) {
                        success = 0;
@@ -332,11 +335,10 @@ static int __init ppro_init(char ** cpu_type)
 {
        __u8 cpu_model = boot_cpu_data.x86_model;
 
-       if (cpu_model == 14)
-               *cpu_type = "i386/core";
-       else if (cpu_model > 0xd)
+       if (cpu_model > 0xd)
                return 0;
-       else if (cpu_model == 9) {
+
+       if (cpu_model == 9) {
                *cpu_type = "i386/p6_mobile";
        } else if (cpu_model > 5) {
                *cpu_type = "i386/piii";