summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-03-02 22:25:37 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-03-02 22:25:37 +0100
commitdfcacc154fb38fdb2c243c3dbbdc1f26a64cedc8 (patch)
tree3b46fb9c61a769612c88c49bd4d528c37bb8b3b1 /kernel
parent31a3409065d1d5bf0f12ad76b8c7f471134bf596 (diff)
cpuidle: Clean up fallback handling in cpuidle_idle_call()
Move the fallback code path in cpuidle_idle_call() to the end of the function to avoid jumping to a label in an if () branch. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/idle.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index f59198bda1bf..84b93b68482a 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -124,20 +124,8 @@ static void cpuidle_idle_call(void)
* Fall back to the default arch idle method on errors.
*/
next_state = cpuidle_select(drv, dev);
- if (next_state < 0) {
-use_default:
- /*
- * We can't use the cpuidle framework, let's use the default
- * idle routine.
- */
- if (current_clr_polling_and_test())
- local_irq_enable();
- else
- arch_cpu_idle();
-
- goto exit_idle;
- }
-
+ if (next_state < 0)
+ goto use_default;
/*
* The idle task must be scheduled, it is pointless to
@@ -195,6 +183,19 @@ exit_idle:
rcu_idle_exit();
start_critical_timings();
+ return;
+
+use_default:
+ /*
+ * We can't use the cpuidle framework, let's use the default
+ * idle routine.
+ */
+ if (current_clr_polling_and_test())
+ local_irq_enable();
+ else
+ arch_cpu_idle();
+
+ goto exit_idle;
}
/*