[RFC PATCH 1/3] ARM: Add cpu power management notifiers
Russell King - ARM Linux
linux at arm.linux.org.uk
Sat Feb 12 09:46:17 EST 2011
On Thu, Feb 10, 2011 at 01:31:25PM -0800, Colin Cross wrote:
> +int cpu_pm_enter(void)
> +{
> + int nr_calls;
> + int ret;
> +
> + spin_lock(&idle_notifier_lock);
> + ret = __idle_notify(CPU_PM_ENTER, -1, &nr_calls);
> + if (ret) {
> + __idle_notify(CPU_PM_ENTER_FAILED, nr_calls - 1, NULL);
> + spin_unlock(&idle_notifier_lock);
> + return ret;
> + }
> + spin_unlock(&idle_notifier_lock);
> +
> + return 0;
Wouldn't:
spin_lock(&idle_notifier_lock);
ret = __idle_notify(CPU_PM_ENTER, -1, &nr_calls);
if (ret)
__idle_notify(CPU_PM_ENTER_FAILED, nr_calls - 1, NULL);
spin_unlock(&idle_notifier_lock);
return ret;
be easier reading?
More information about the linux-arm-kernel
mailing list