Skip to content

Commit

Permalink
[POWERPC] Allow smp_call_function_single() to current cpu
Browse files Browse the repository at this point in the history
This removes the requirement for callers to get_cpu() to check in simple
cases.  i386 and x86_64 already received a similar treatment.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Avi Kivity authored and Paul Mackerras committed Jul 22, 2007
1 parent 08ae6cc commit adff093
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,19 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
int wait)
{
cpumask_t map = CPU_MASK_NONE;
int ret = -EBUSY;
int ret = 0;

if (!cpu_online(cpu))
return -EINVAL;

cpu_set(cpu, map);
if (cpu != get_cpu())
ret = smp_call_function_map(func,info,nonatomic,wait,map);
else {
local_irq_disable();
func(info);
local_irq_enable();
}
put_cpu();
return ret;
}
Expand Down

0 comments on commit adff093

Please sign in to comment.