Commit 2339405e authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] UML: use for_each_cpu

Use for_each_cpu rather than iterating over processors by hand.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 986edf12
...@@ -45,8 +45,7 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -45,8 +45,7 @@ int show_interrupts(struct seq_file *p, void *v)
if (i == 0) { if (i == 0) {
seq_printf(p, " "); seq_printf(p, " ");
for (j=0; j<NR_CPUS; j++) for_each_cpu(j)
if (cpu_online(j))
seq_printf(p, "CPU%d ",j); seq_printf(p, "CPU%d ",j);
seq_putc(p, '\n'); seq_putc(p, '\n');
} }
...@@ -60,8 +59,7 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -60,8 +59,7 @@ int show_interrupts(struct seq_file *p, void *v)
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
seq_printf(p, "%10u ", kstat_irqs(i)); seq_printf(p, "%10u ", kstat_irqs(i));
#else #else
for (j = 0; j < NR_CPUS; j++) for_each_cpu(j)
if (cpu_online(j))
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
#endif #endif
seq_printf(p, " %14s", irq_desc[i].handler->typename); seq_printf(p, " %14s", irq_desc[i].handler->typename);
......
...@@ -247,9 +247,7 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic, ...@@ -247,9 +247,7 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic,
func = _func; func = _func;
info = _info; info = _info;
for (i=0;i<NR_CPUS;i++) for_each_cpu(i)
if((i != current_thread->cpu) &&
cpu_isset(i, cpu_online_map))
os_write_file(cpu_data[i].ipi_pipe[1], "C", 1); os_write_file(cpu_data[i].ipi_pipe[1], "C", 1);
while (atomic_read(&scf_started) != cpus) while (atomic_read(&scf_started) != cpus)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment