[PATCH] ia64 sn_hwperf use of num_online_cpus()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eliminate an unnecessary -- and flawed -- use of the expensive
num_online_cpus().

Signed-off-by: John Hawkes <[email protected]>

Index: linux/arch/ia64/sn/kernel/sn2/sn_hwperf.c
===================================================================
--- linux.orig/arch/ia64/sn/kernel/sn2/sn_hwperf.c	2006-03-19 21:53:29.000000000 -0800
+++ linux/arch/ia64/sn/kernel/sn2/sn_hwperf.c	2006-03-27 13:14:12.000000000 -0800
@@ -605,7 +605,7 @@ static int sn_hwperf_op_cpu(struct sn_hw
 	op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK;
 
 	if (cpu != SN_HWPERF_ARG_ANY_CPU) {
-		if (cpu >= num_online_cpus() || !cpu_online(cpu)) {
+		if (cpu >= NR_CPUS || !cpu_online(cpu)) {
 			r = -EINVAL;
 			goto out;
 		}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux