History

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.

Rafael J. Wysocki committed 11 years ago

Commit dfcacc11 parent 31a34091 file · +15 −14Browse files

Unified · Split

kernel/sched/idle.c+15−14
@@ -124,20 +124,8 @@ static void cpuidle_idle_call(void) · 123 unmodified lines
124124 * Fall back to the default arch idle method on errors.
125125 */
126126 next_state = cpuidle_select(drv, dev);
127− if (next_state < 0) {
128−use_default:
129− /*
130− * We can't use the cpuidle framework, let's use the default
131− * idle routine.
132− */
133− if (current_clr_polling_and_test())
134− local_irq_enable();
135− else
136− arch_cpu_idle();
137−
138− goto exit_idle;
139− }
140−
127+ if (next_state < 0)
128+ goto use_default;
141129
142130 /*
143131 * The idle task must be scheduled, it is pointless to
@@ -195,6 +183,19 @@ exit_idle: · 51 unmodified lines
195183
196184 rcu_idle_exit();
197185 start_critical_timings();
186+ return;
187+
188+use_default:
189+ /*
190+ * We can't use the cpuidle framework, let's use the default
191+ * idle routine.
192+ */
193+ if (current_clr_polling_and_test())
194+ local_irq_enable();
195+ else
196+ arch_cpu_idle();
197+
198+ goto exit_idle;
198199 }
199200
200201 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t