Subject: [PATCH v6 13/15] ARM: hotplug: Introducedummy_cpu_kill

From: [email-masked] (Marc Zyngier)
Date: Thu, 09 Feb 2012 01:57:08 +0100

On Wed, 8 Feb 2012 16:16:24 -0800 (PST), Nicolas Pitre
<[email-masked]> wrote:
> On Wed, 8 Feb 2012, Marc Zyngier wrote:
> 
>> Most platforms don't implement their cpu_kill method.
>> Some because they simply don't offer the capability, some other
>> because nobody cared enough to implement the necessary code.
>> 
>> Either way, this code is duplicated all over the place. Implement
>> a global dummy_cpu_kill method and convert all SMP (but shmobile)
>> to use it. Hopefully the "dummy" prefix will be an incentive
>> for people to do the right thing.
>> 
>> Cc: Arnd Bergmann <[email-masked]>
>> Cc: Colin Cross <[email-masked]>
>> Cc: David Brown <[email-masked]>
>> Cc: Kukjin Kim <[email-masked]>
>> Cc: Linus Walleij <[email-masked]>
>> Cc: Magnus Damm <[email-masked]>
>> Cc: Nicolas Pitre <[email-masked]>
>> Cc: Paul Mundt <[email-masked]>
>> Cc: Santosh Shilimkar <[email-masked]>
>> Cc: Stephen Warren <[email-masked]>
>> Cc: Shawn Guo <[email-masked]>
>> Cc: Rob Herring <[email-masked]>
>> Signed-off-by: Marc Zyngier <[email-masked]>
> 
> What avout this instead:
> 
> int __weak __cpuinit platform_cpu_kill(unsigned int cpu)
> {
> 	if (!soc_smp_ops)
> 		return 0;
> 	if (!soc_smp_ops->cpu_kill)
> 		return 1;
> 	return soc_smp_ops->cpu_kill(cpu);
> }
> 
> and get rid of the dummy handler entirely?

I thought the "dummy" prefix would maybe give maintainers a chance to
think whether or not this is the best they can do (given that they mostly
copied the RealView code, I'm quite sure it is possible...). I'll use your
approach if you think it's better.

        M.
-- 
Fast, cheap, reliable. Pick two.