Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch: Cleanup enable/disable_hlt

enable/disable_hlt() does not need to be exported and can be killed on
architectures which do not use it at all.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20130321215233.377959540@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

+3 -60
-4
arch/arm/kernel/process.c
··· 64 64 hlt_counter++; 65 65 } 66 66 67 - EXPORT_SYMBOL(disable_hlt); 68 - 69 67 void enable_hlt(void) 70 68 { 71 69 hlt_counter--; 72 70 BUG_ON(hlt_counter < 0); 73 71 } 74 - 75 - EXPORT_SYMBOL(enable_hlt); 76 72 77 73 static int __init nohlt_setup(char *__unused) 78 74 {
+3 -5
arch/cris/arch-v32/kernel/process.c
··· 20 20 21 21 extern void stop_watchdog(void); 22 22 23 - extern int cris_hlt_counter; 24 - 25 23 /* We use this if we don't have any better idle routine. */ 26 24 void default_idle(void) 27 25 { 28 26 local_irq_disable(); 29 - if (!need_resched() && !cris_hlt_counter) { 30 - /* Halt until exception. */ 27 + if (!need_resched()) { 28 + /* Halt until exception. */ 31 29 __asm__ volatile("ei \n\t" 32 - "halt "); 30 + "halt "); 33 31 } 34 32 local_irq_enable(); 35 33 }
-7
arch/cris/include/asm/processor.h
··· 65 65 66 66 #define cpu_relax() barrier() 67 67 68 - /* 69 - * disable hlt during certain critical i/o operations 70 - */ 71 - #define HAVE_DISABLE_HLT 72 - void disable_hlt(void); 73 - void enable_hlt(void); 74 - 75 68 void default_idle(void); 76 69 77 70 #endif /* __ASM_CRIS_PROCESSOR_H */
-25
arch/cris/kernel/process.c
··· 29 29 30 30 //#define DEBUG 31 31 32 - /* 33 - * The hlt_counter, disable_hlt and enable_hlt is just here as a hook if 34 - * there would ever be a halt sequence (for power save when idle) with 35 - * some largish delay when halting or resuming *and* a driver that can't 36 - * afford that delay. The hlt_counter would then be checked before 37 - * executing the halt sequence, and the driver marks the unhaltable 38 - * region by enable_hlt/disable_hlt. 39 - */ 40 - 41 - int cris_hlt_counter=0; 42 - 43 - void disable_hlt(void) 44 - { 45 - cris_hlt_counter++; 46 - } 47 - 48 - EXPORT_SYMBOL(disable_hlt); 49 - 50 - void enable_hlt(void) 51 - { 52 - cris_hlt_counter--; 53 - } 54 - 55 - EXPORT_SYMBOL(enable_hlt); 56 - 57 32 extern void default_idle(void); 58 33 59 34 void (*pm_power_off)(void);
-2
arch/microblaze/include/asm/processor.h
··· 160 160 # define STACK_TOP TASK_SIZE 161 161 # define STACK_TOP_MAX STACK_TOP 162 162 163 - void disable_hlt(void); 164 - void enable_hlt(void); 165 163 void default_idle(void); 166 164 167 165 #ifdef CONFIG_DEBUG_FS
-12
arch/microblaze/kernel/process.c
··· 46 46 47 47 static int hlt_counter = 1; 48 48 49 - void disable_hlt(void) 50 - { 51 - hlt_counter++; 52 - } 53 - EXPORT_SYMBOL(disable_hlt); 54 - 55 - void enable_hlt(void) 56 - { 57 - hlt_counter--; 58 - } 59 - EXPORT_SYMBOL(enable_hlt); 60 - 61 49 static int __init nohlt_setup(char *__unused) 62 50 { 63 51 hlt_counter = 1;
-5
arch/mn10300/kernel/smp.c
··· 935 935 int timeout; 936 936 937 937 #ifdef CONFIG_HOTPLUG_CPU 938 - if (num_online_cpus() == 1) 939 - disable_hlt(); 940 938 if (sleep_mode[cpu]) 941 939 run_wakeup_cpu(cpu); 942 940 #endif /* CONFIG_HOTPLUG_CPU */ ··· 1001 1003 void __cpu_die(unsigned int cpu) 1002 1004 { 1003 1005 run_sleep_cpu(cpu); 1004 - 1005 - if (num_online_cpus() == 1) 1006 - enable_hlt(); 1007 1006 } 1008 1007 1009 1008 #ifdef CONFIG_MN10300_CACHE_ENABLED