Skip to content

Commit

Permalink
cpumask: use for_each_online_cpu() in drivers/infiniband/hw/ehca/ehca…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
Rusty Russell committed Dec 29, 2008
1 parent ce47d97 commit 259c4dd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/infiniband/hw/ehca/ehca_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,10 +934,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);
}

0 comments on commit 259c4dd

Please sign in to comment.