Re: [RFC PATCH 1/3] ARM: Add cpu power management notifiers

From: Russell King - ARM Linux
Date: Sat Feb 12 2011 - 09:47:38 EST


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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/