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) ...@@ -45,9 +45,8 @@ 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,9 +59,8 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -60,9 +59,8 @@ 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);
seq_printf(p, " %s", action->name); seq_printf(p, " %s", action->name);
......
...@@ -247,10 +247,8 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic, ...@@ -247,10 +247,8 @@ 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) && os_write_file(cpu_data[i].ipi_pipe[1], "C", 1);
cpu_isset(i, cpu_online_map))
os_write_file(cpu_data[i].ipi_pipe[1], "C", 1);
while (atomic_read(&scf_started) != cpus) while (atomic_read(&scf_started) != cpus)
barrier(); 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