diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-29 17:35:17 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-29 17:35:17 -0500 |
commit | 259c4ddd00237e5072921afa15a900839643fd98 (patch) | |
tree | 1b97200c6590347e5e094f73774ce8fbf3d223fa /drivers/infiniband | |
parent | ce47d974f71af26d00832e83a43ac79bec272d99 (diff) |
cpumask: use for_each_online_cpu() in drivers/infiniband/hw/ehca/ehca_irq.c
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>
Acked-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Tested-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Cc: Christoph Raisch <raisch@de.ibm.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_irq.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index 757035ea246f..6305209fdea8 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c | |||
@@ -934,10 +934,9 @@ void ehca_destroy_comp_pool(void) | |||
934 | 934 | ||
935 | unregister_hotcpu_notifier(&comp_pool_callback_nb); | 935 | unregister_hotcpu_notifier(&comp_pool_callback_nb); |
936 | 936 | ||
937 | for (i = 0; i < NR_CPUS; i++) { | 937 | for_each_online_cpu(i) |
938 | if (cpu_online(i)) | 938 | destroy_comp_task(pool, i); |
939 | destroy_comp_task(pool, i); | 939 | |
940 | } | ||
941 | free_percpu(pool->cpu_comp_tasks); | 940 | free_percpu(pool->cpu_comp_tasks); |
942 | kfree(pool); | 941 | kfree(pool); |
943 | } | 942 | } |