aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2006-03-28 04:56:37 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-28 12:16:05 -0500
commit0a945022778f100115d0cb6234eb28fc1b15ccaf (patch)
tree85df4b5f7dd8bf59557091379c59b23b09115bf6 /mm
parent631d6747e1d877a4baa924cb373b8b9511a53e5e (diff)
[PATCH] for_each_possible_cpu: fixes for generic part
replaces for_each_cpu with for_each_possible_cpu(). Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.c4
-rw-r--r--mm/swap.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 681837499d7d..4cbf8bb13557 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3311,7 +3311,7 @@ void *__alloc_percpu(size_t size)
3311 * and we have no way of figuring out how to fix the array 3311 * and we have no way of figuring out how to fix the array
3312 * that we have allocated then.... 3312 * that we have allocated then....
3313 */ 3313 */
3314 for_each_cpu(i) { 3314 for_each_possible_cpu(i) {
3315 int node = cpu_to_node(i); 3315 int node = cpu_to_node(i);
3316 3316
3317 if (node_online(node)) 3317 if (node_online(node))
@@ -3398,7 +3398,7 @@ void free_percpu(const void *objp)
3398 /* 3398 /*
3399 * We allocate for all cpus so we cannot use for online cpu here. 3399 * We allocate for all cpus so we cannot use for online cpu here.
3400 */ 3400 */
3401 for_each_cpu(i) 3401 for_each_possible_cpu(i)
3402 kfree(p->ptrs[i]); 3402 kfree(p->ptrs[i]);
3403 kfree(p); 3403 kfree(p);
3404} 3404}
diff --git a/mm/swap.c b/mm/swap.c
index 91b7e2026f69..88895c249bc9 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -512,7 +512,7 @@ long percpu_counter_sum(struct percpu_counter *fbc)
512 512
513 spin_lock(&fbc->lock); 513 spin_lock(&fbc->lock);
514 ret = fbc->count; 514 ret = fbc->count;
515 for_each_cpu(cpu) { 515 for_each_possible_cpu(cpu) {
516 long *pcount = per_cpu_ptr(fbc->counters, cpu); 516 long *pcount = per_cpu_ptr(fbc->counters, cpu);
517 ret += *pcount; 517 ret += *pcount;
518 } 518 }