Commit 9f989ac8 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] remove sparc64's num_possible_cpus()

Levent Serinol <levent.serinol@mynet.com> found that the hotplug cpu
patch broke Sparc64.  I introduced a num_possible_cpus(), which
Sparc64 already has.  Remove the Sparc64 one.

I also removed Sparc64's cpu_online() macro: it's in linux/cpumask.h
already.
parent a59d2e4e
......@@ -46,7 +46,6 @@ extern void calibrate_delay(void);
static unsigned char boot_cpu_id;
cpumask_t cpu_online_map = CPU_MASK_NONE;
atomic_t sparc64_num_cpus_possible = ATOMIC_INIT(0);
cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
static cpumask_t smp_commenced_mask;
static cpumask_t cpu_callout_map;
......@@ -1236,20 +1235,17 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
instance = 0;
while (!cpu_find_by_instance(instance, NULL, &mid)) {
if (mid < max_cpus) {
if (mid < max_cpus)
cpu_set(mid, phys_cpu_present_map);
atomic_inc(&sparc64_num_cpus_possible);
}
instance++;
}
if (atomic_read(&sparc64_num_cpus_possible) > max_cpus) {
if (num_possible_cpus() > max_cpus) {
instance = 0;
while (!cpu_find_by_instance(instance, NULL, &mid)) {
if (mid != boot_cpu_id) {
cpu_clear(mid, phys_cpu_present_map);
atomic_dec(&sparc64_num_cpus_possible);
if (atomic_read(&sparc64_num_cpus_possible) <= max_cpus)
if (num_possible_cpus() <= max_cpus)
break;
}
instance++;
......
......@@ -145,7 +145,6 @@ EXPORT_SYMBOL_NOVERS(mcount);
/* CPU online map and active count. */
EXPORT_SYMBOL(cpu_online_map);
EXPORT_SYMBOL(phys_cpu_present_map);
EXPORT_SYMBOL(sparc64_num_cpus_possible);
/* Spinlock debugging library, optional. */
#ifdef CONFIG_DEBUG_SPINLOCK
......
......@@ -35,11 +35,6 @@ extern unsigned char boot_cpu_id;
extern cpumask_t phys_cpu_present_map;
#define cpu_possible_map phys_cpu_present_map
#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
extern atomic_t sparc64_num_cpus_possible;
#define num_possible_cpus() (atomic_read(&sparc64_num_cpus_possible))
/*
* General functions that each host system must provide.
*/
......@@ -75,10 +70,6 @@ static __inline__ int hard_smp_processor_id(void)
#endif /* !(__ASSEMBLY__) */
#else
#define num_possible_cpus() (1)
#endif /* !(CONFIG_SMP) */
#define NO_PROC_ID 0xFF
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment