* [PATCH] x86: remove dead code
@ 2007-12-13 9:43 Jan Beulich
0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2007-12-13 9:43 UTC (permalink / raw)
To: tglx, mingo, hpa; +Cc: linux-kernel
Neither __cpu_disable() nor __cpu_die() are being referenced without
CONFIG_HOTPLUG_CPU.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
arch/x86/kernel/smpboot_32.c | 11 -----------
arch/x86/kernel/smpboot_64.c | 12 ------------
2 files changed, 23 deletions(-)
--- linux-2.6.24-rc5/arch/x86/kernel/smpboot_32.c 2007-12-12 11:28:18.000000000 +0100
+++ 2.6.24-rc5-x86-cpu-die/arch/x86/kernel/smpboot_32.c 2007-12-07 16:12:01.000000000 +0100
@@ -1232,17 +1232,6 @@ void __cpu_die(unsigned int cpu)
}
printk(KERN_ERR "CPU %u didn't die...\n", cpu);
}
-#else /* ... !CONFIG_HOTPLUG_CPU */
-int __cpu_disable(void)
-{
- return -ENOSYS;
-}
-
-void __cpu_die(unsigned int cpu)
-{
- /* We said "no" in __cpu_disable */
- BUG();
-}
#endif /* CONFIG_HOTPLUG_CPU */
int __cpuinit native_cpu_up(unsigned int cpu)
--- linux-2.6.24-rc5/arch/x86/kernel/smpboot_64.c 2007-12-12 11:28:18.000000000 +0100
+++ 2.6.24-rc5-x86-cpu-die/arch/x86/kernel/smpboot_64.c 2007-12-07 16:12:17.000000000 +0100
@@ -1084,16 +1084,4 @@ static __init int setup_additional_cpus(
}
early_param("additional_cpus", setup_additional_cpus);
-#else /* ... !CONFIG_HOTPLUG_CPU */
-
-int __cpu_disable(void)
-{
- return -ENOSYS;
-}
-
-void __cpu_die(unsigned int cpu)
-{
- /* We said "no" in __cpu_disable */
- BUG();
-}
#endif /* CONFIG_HOTPLUG_CPU */
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH] x86 : remove dead code
@ 2012-10-25 16:13 Daniel Lezcano
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Lezcano @ 2012-10-25 16:13 UTC (permalink / raw)
To: tglx, mingo, hpa; +Cc: x86, linaro-dev, patches, linux-kernel
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 <daniel.lezcano@linaro.org>
---
arch/x86/kernel/process.c | 39 ++++++++++++++-------------------------
1 files changed, 14 insertions(+), 25 deletions(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index b644e1c..2f99e31 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -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);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-25 16:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-13 9:43 [PATCH] x86: remove dead code Jan Beulich
-- strict thread matches above, loose matches on Subject: below --
2012-10-25 16:13 [PATCH] x86 : " Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox