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,9 +45,8 @@ int show_interrupts(struct seq_file *p, void *v)
if (i == 0) {
seq_printf(p, " ");
for (j=0; j<NR_CPUS; j++)
if (cpu_online(j))
seq_printf(p, "CPU%d ",j);
for_each_cpu(j)
seq_printf(p, "CPU%d ",j);
seq_putc(p, '\n');
}
......@@ -60,9 +59,8 @@ int show_interrupts(struct seq_file *p, void *v)
#ifndef CONFIG_SMP
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for (j = 0; j < NR_CPUS; j++)
if (cpu_online(j))
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
for_each_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
#endif
seq_printf(p, " %14s", irq_desc[i].handler->typename);
seq_printf(p, " %s", action->name);
......
......@@ -247,10 +247,8 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic,
func = _func;
info = _info;
for (i=0;i<NR_CPUS;i++)
if((i != current_thread->cpu) &&
cpu_isset(i, cpu_online_map))
os_write_file(cpu_data[i].ipi_pipe[1], "C", 1);
for_each_cpu(i)
os_write_file(cpu_data[i].ipi_pipe[1], "C", 1);
while (atomic_read(&scf_started) != cpus)
barrier();
......
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