From: Jan Beulich Date: Tue, 27 Apr 2010 21:01:20 +0000 (-0700) Subject: drivers/base/cpu.c: fix the output from /sys/devices/system/cpu/offline X-Git-Tag: firefly_0821_release~10186^2~1538 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4f75f44a4a4437ad69beaac04047c4e66a956932;p=firefly-linux-kernel-4.4.55.git drivers/base/cpu.c: fix the output from /sys/devices/system/cpu/offline commit cdc6e3d3968052cebb2f2ddcd742bff29fbd1a90 upstream. Without CONFIG_CPUMASK_OFFSTACK, simply inverting cpu_online_mask leads to CPUs beyond nr_cpu_ids to be displayed twice and CPUs not even possible to be displayed as offline. Signed-off-by: Jan Beulich Cc: Andi Kleen Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index e62a4ccea54d..1e2196fef1c7 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -149,7 +149,7 @@ static ssize_t print_cpus_offline(struct sysdev_class *class, char *buf) /* display offline cpus < nr_cpu_ids */ if (!alloc_cpumask_var(&offline, GFP_KERNEL)) return -ENOMEM; - cpumask_complement(offline, cpu_online_mask); + cpumask_andnot(offline, cpu_possible_mask, cpu_online_mask); n = cpulist_scnprintf(buf, len, offline); free_cpumask_var(offline);