diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2015-03-04 19:19:19 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-03-09 23:24:42 -0400 |
commit | c8ed00107b60b4a890798677d75e5c2910f393bb (patch) | |
tree | 48a0440907bbef7d8d1d71d090881ba00192ee65 /arch/sh/kernel/smp.c | |
parent | 2f0f267ea0720ec6adbe9cf7386450425fac8258 (diff) |
Fix weird uses of num_online_cpus().
This may be OK in archs with contiguous CPU numbers and without
hotplug CPUs, but it sets a terrible example.
And open-coding it like drivers/scsi/hpsa.c is just weird.
BTRFS has a weird comparison with num_online_cpus() too, but since
BTRFS just screwed up my test machines' root partition, I'm not
touching it :)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reported-by: Oleg Drokin <green@linuxhacker.ru>
Diffstat (limited to 'arch/sh/kernel/smp.c')
-rw-r--r-- | arch/sh/kernel/smp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index fc5acfc93c92..de6be008fc01 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c | |||
@@ -363,7 +363,7 @@ void flush_tlb_mm(struct mm_struct *mm) | |||
363 | smp_call_function(flush_tlb_mm_ipi, (void *)mm, 1); | 363 | smp_call_function(flush_tlb_mm_ipi, (void *)mm, 1); |
364 | } else { | 364 | } else { |
365 | int i; | 365 | int i; |
366 | for (i = 0; i < num_online_cpus(); i++) | 366 | for_each_online_cpu(i) |
367 | if (smp_processor_id() != i) | 367 | if (smp_processor_id() != i) |
368 | cpu_context(i, mm) = 0; | 368 | cpu_context(i, mm) = 0; |
369 | } | 369 | } |
@@ -400,7 +400,7 @@ void flush_tlb_range(struct vm_area_struct *vma, | |||
400 | smp_call_function(flush_tlb_range_ipi, (void *)&fd, 1); | 400 | smp_call_function(flush_tlb_range_ipi, (void *)&fd, 1); |
401 | } else { | 401 | } else { |
402 | int i; | 402 | int i; |
403 | for (i = 0; i < num_online_cpus(); i++) | 403 | for_each_online_cpu(i) |
404 | if (smp_processor_id() != i) | 404 | if (smp_processor_id() != i) |
405 | cpu_context(i, mm) = 0; | 405 | cpu_context(i, mm) = 0; |
406 | } | 406 | } |
@@ -443,7 +443,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | |||
443 | smp_call_function(flush_tlb_page_ipi, (void *)&fd, 1); | 443 | smp_call_function(flush_tlb_page_ipi, (void *)&fd, 1); |
444 | } else { | 444 | } else { |
445 | int i; | 445 | int i; |
446 | for (i = 0; i < num_online_cpus(); i++) | 446 | for_each_online_cpu(i) |
447 | if (smp_processor_id() != i) | 447 | if (smp_processor_id() != i) |
448 | cpu_context(i, vma->vm_mm) = 0; | 448 | cpu_context(i, vma->vm_mm) = 0; |
449 | } | 449 | } |