public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/6] cpumask: Use find_last_bit()
@ 2008-12-01  8:18 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2008-12-01  8:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Mike Travis

Impact: cleanup

There's one obvious place to use it: to find the highest possible cpu.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 init/main.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff -r 911f0f14f90b init/main.c
--- a/init/main.c	Fri Nov 07 16:28:47 2008 +1100
+++ b/init/main.c	Fri Nov 07 16:29:00 2008 +1100
@@ -379,12 +379,7 @@ EXPORT_SYMBOL(nr_cpu_ids);
 /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
 static void __init setup_nr_cpu_ids(void)
 {
-	int cpu, highest_cpu = 0;
-
-	for_each_possible_cpu(cpu)
-		highest_cpu = cpu;
-
-	nr_cpu_ids = highest_cpu + 1;
+	nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
 }
 
 #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-01  8:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-01  8:18 [PATCH 6/6] cpumask: Use find_last_bit() Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox