cpu_set(cpuid, cpu_callin_map);
 }
 
-static int cpucount;
-
 /*
  * Activate a secondary processor.
  */
        /* start_eip had better be page-aligned! */
        start_eip = setup_trampoline();
 
-       ++cpucount;
        alternatives_smp_switch(1);
 
        /* So we see what's up   */
                cpu_clear(cpu, cpu_initialized); /* was set by cpu_init() */
                cpu_clear(cpu, cpu_possible_map);
                per_cpu(x86_cpu_to_apicid, cpu) = BAD_APICID;
-               cpucount--;
        }
 
        /* mark "stuck" area as not stuck */
 
        idle_task_exit();
 
-       cpucount --;
        cpu_uninit();
        irq_ctx_exit(cpu);
 
        return 0;
 }
 
-
 /*
  * Cycle through the processors sending APIC IPIs to boot each.
  */
 
                if (!check_apicid_present(bit))
                        continue;
-               if (max_cpus <= cpucount+1)
+               if (max_cpus <= cpus_weight(cpu_present_map))
                        continue;
                /* Utterly temporary */
                for (cpu = 0; cpu < NR_CPUS; cpu++)
                        bogosum += cpu_data(cpu).loops_per_jiffy;
        printk(KERN_INFO
                "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
-               cpucount+1,
+               cpus_weight(cpu_present_map),
                bogosum/(500000/HZ),
                (bogosum/(5000/HZ))%100);
        
         * approved Athlon
         */
        if (tainted & TAINT_UNSAFE_SMP) {
-               if (cpucount)
+               if (cpus_weight(cpu_present_map))
                        printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n");
                else
                        tainted &= ~TAINT_UNSAFE_SMP;