* [PATCH 1/3] cpumask: use for_each_online_cpu() in drivers/infiniband/hw/ehca/ehca_irq.c
@ 2008-11-21 13:50 Rusty Russell
2008-11-25 12:59 ` Hoang-Nam Nguyen
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2008-11-21 13:50 UTC (permalink / raw)
To: Hoang-Nam Nguyen; +Cc: linux-kernel, Christoph Raisch, Christoph Raisch
Impact: cleanup
In future, accessing cpu numbers beyond nr_cpu_ids (the runtime limit)
will be undefined. We can avoid future problems by using
for_each_online_cpu() here.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Cc: Christoph Raisch <raisch@de.ibm.com>
---
drivers/infiniband/hw/ehca/ehca_irq.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff -r 38b459d1e9c7 drivers/infiniband/hw/ehca/ehca_irq.c
--- a/drivers/infiniband/hw/ehca/ehca_irq.c Fri Nov 07 22:33:08 2008 +1100
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c Fri Nov 07 22:48:13 2008 +1100
@@ -922,10 +922,9 @@ void ehca_destroy_comp_pool(void)
unregister_hotcpu_notifier(&comp_pool_callback_nb);
- for (i = 0; i < NR_CPUS; i++) {
- if (cpu_online(i))
- destroy_comp_task(pool, i);
- }
+ for_each_online_cpu(i)
+ destroy_comp_task(pool, i);
+
free_percpu(pool->cpu_comp_tasks);
kfree(pool);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-25 12:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-21 13:50 [PATCH 1/3] cpumask: use for_each_online_cpu() in drivers/infiniband/hw/ehca/ehca_irq.c Rusty Russell
2008-11-25 12:59 ` Hoang-Nam Nguyen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.