x86 : remove dead code
PATCH 1/1 x86 : remove dead code
The hlt_use_halt function returns always true and there is only one definition of it.
The default_idle function can then get ride of the if ... statement and we can remove the else branch.
Signed-off-by Daniel Lezcano <[email protected]>
--- arch/x86/kernel/process.c | 39 ++++++++++++++------------------------- 1 files changed, 14 insertions(+), 25 deletions(-)
arch/x86/kernel/process.c +14 -25
@@ -306,11 +306,6 @@ void (*pm_idle)(void);EXPORT_SYMBOL (pm_idle);#endif -static inline int hlt_use_halt (void ) -{ -return 1 ; -} -#ifndef CONFIG_SMP static inline void play_dead (void ) {
@@ -410,28 +405,22 @@ void cpu_idle(void)*/ void default_idle (void ) { -if (hlt_use_halt ()) { -trace_power_start_rcuidle (POWER_CSTATE ,1 ,smp_processor_id ()); -trace_cpu_idle_rcuidle (1 ,smp_processor_id ()); -current_thread_info ()->status &= ~TS_POLLING ; -/* -* TS_POLLING-cleared state must be visible before we -* test NEED_RESCHED: -*/ -smp_mb (); +trace_power_start_rcuidle (POWER_CSTATE ,1 ,smp_processor_id ()); +trace_cpu_idle_rcuidle (1 ,smp_processor_id ()); +current_thread_info ()->status &= ~TS_POLLING ; +/* +* TS_POLLING-cleared state must be visible before we +* test NEED_RESCHED: +*/ +smp_mb (); -if (!need_resched ()) -safe_halt ();/* enables interrupts racelessly */ -else -local_irq_enable (); -current_thread_info ()->status |=TS_POLLING ; -trace_power_end_rcuidle (smp_processor_id ()); -trace_cpu_idle_rcuidle (PWR_EVENT_EXIT ,smp_processor_id ()); - }else { +if (!need_resched ()) +safe_halt ();/* enables interrupts racelessly */ +else local_irq_enable (); -/* loop is done by the caller */ -cpu_relax (); - } +current_thread_info ()->status |=TS_POLLING ; +trace_power_end_rcuidle (smp_processor_id ()); +trace_cpu_idle_rcuidle (PWR_EVENT_EXIT ,smp_processor_id ()); }#ifdef CONFIG_APM_MODULE EXPORT_SYMBOL (default_idle);
Signature · 1 line
1.7.5.4
[tip:x86/cleanups] x86: Remove dead hlt_use_halt code
Commit-ID: 4d0e42cc66f4e7e0bf08b29da1ae6ebd60549c4e Gitweb: http://git.kernel.org/tip/4d0e42cc66f4e7e0bf08b29da1ae6ebd60549c4e Author: Daniel Lezcano <[email protected]> AuthorDate: Thu, 25 Oct 2012 18:13:11 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 26 Oct 2012 12:25:03 +0200
x86: Remove dead hlt_use_halt code
The hlt_use_halt function returns always true and there is only one definition of it.
The default_idle function can then get ride of the if ... statement and we can remove the else branch.
Signed-off-by Daniel Lezcano <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- arch/x86/kernel/process.c | 39 ++++++++++++++------------------------- 1 files changed, 14 insertions(+), 25 deletions(-)
arch/x86/kernel/process.c +14 -25
@@ -306,11 +306,6 @@ void (*pm_idle)(void);EXPORT_SYMBOL (pm_idle);#endif -static inline int hlt_use_halt (void ) -{ -return 1 ; -} -#ifndef CONFIG_SMP static inline void play_dead (void ) {
@@ -410,28 +405,22 @@ void cpu_idle(void)*/ void default_idle (void ) { -if (hlt_use_halt ()) { -trace_power_start_rcuidle (POWER_CSTATE ,1 ,smp_processor_id ()); -trace_cpu_idle_rcuidle (1 ,smp_processor_id ()); -current_thread_info ()->status &= ~TS_POLLING ; -/* -* TS_POLLING-cleared state must be visible before we -* test NEED_RESCHED: -*/ -smp_mb (); +trace_power_start_rcuidle (POWER_CSTATE ,1 ,smp_processor_id ()); +trace_cpu_idle_rcuidle (1 ,smp_processor_id ()); +current_thread_info ()->status &= ~TS_POLLING ; +/* +* TS_POLLING-cleared state must be visible before we +* test NEED_RESCHED: +*/ +smp_mb (); -if (!need_resched ()) -safe_halt ();/* enables interrupts racelessly */ -else -local_irq_enable (); -current_thread_info ()->status |=TS_POLLING ; -trace_power_end_rcuidle (smp_processor_id ()); -trace_cpu_idle_rcuidle (PWR_EVENT_EXIT ,smp_processor_id ()); - }else { +if (!need_resched ()) +safe_halt ();/* enables interrupts racelessly */ +else local_irq_enable (); -/* loop is done by the caller */ -cpu_relax (); - } +current_thread_info ()->status |=TS_POLLING ; +trace_power_end_rcuidle (smp_processor_id ()); +trace_cpu_idle_rcuidle (PWR_EVENT_EXIT ,smp_processor_id ()); }#ifdef CONFIG_APM_MODULE EXPORT_SYMBOL (default_idle);