From: Adrian Bunk include/linux/platform.h contained nothing that was actually used except the default_idle() prototype, and is therefore removed by this patch. This patch does the following with the platform specific default_idle() functions on different architectures: - remove the unused function: - parisc - sparc64 - make the needlessly global function static: - arm - h8300 - m68k - m68knommu - s390 - v850 - x86_64 - add a prototype in asm/system.h: - cris - i386 - ia64 Signed-off-by: Adrian Bunk Acked-by: Patrick Mochel Acked-by: Kyle McMartin Signed-off-by: Andrew Morton --- dev/null | 43 ------------------------------ sparc64/kernel/process.c | 0 arch/arm/kernel/process.c | 2 - arch/cris/kernel/process.c | 3 -- arch/h8300/kernel/process.c | 4 +- arch/i386/kernel/apm.c | 2 - arch/i386/mach-visws/reboot.c | 1 arch/ia64/kernel/setup.c | 1 arch/m68k/kernel/process.c | 2 - arch/m68knommu/kernel/process.c | 2 - arch/parisc/kernel/process.c | 5 --- arch/s390/kernel/process.c | 2 - arch/sh/kernel/process.c | 1 arch/v850/kernel/process.c | 2 - arch/x86_64/kernel/process.c | 2 - include/asm-cris/system.h | 2 + include/asm-i386/system.h | 2 + include/asm-ia64/system.h | 2 + 18 files changed, 15 insertions(+), 63 deletions(-) diff -puN arch/arm/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/arm/kernel/process.c --- devel/arch/arm/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/arm/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -83,7 +83,7 @@ EXPORT_SYMBOL(pm_power_off); * This is our default idle handler. We need to disable * interrupts here to ensure we don't miss a wakeup call. */ -void default_idle(void) +static void default_idle(void) { if (hlt_counter) cpu_relax(); diff -puN arch/cris/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/cris/kernel/process.c --- devel/arch/cris/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/cris/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -116,6 +116,7 @@ #include #include #include +#include #include #include #include @@ -194,8 +195,6 @@ EXPORT_SYMBOL(enable_hlt); */ void (*pm_idle)(void); -extern void default_idle(void); - /* * The idle thread. There's no useful work to be * done, so just try to conserve power and have a diff -puN arch/h8300/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/h8300/kernel/process.c --- devel/arch/h8300/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/h8300/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -51,7 +51,7 @@ asmlinkage void ret_from_fork(void); * The idle loop on an H8/300.. */ #if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM) -void default_idle(void) +static void default_idle(void) { local_irq_disable(); if (!need_resched()) { @@ -62,7 +62,7 @@ void default_idle(void) local_irq_enable(); } #else -void default_idle(void) +static void default_idle(void) { cpu_relax(); } diff -puN arch/i386/kernel/apm.c~kill-include-linux-platformh-default_idle-cleanup arch/i386/kernel/apm.c --- devel/arch/i386/kernel/apm.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/i386/kernel/apm.c 2006-02-21 19:19:47.000000000 -0800 @@ -824,8 +824,6 @@ static void apm_do_busy(void) static void (*original_pm_idle)(void); -extern void default_idle(void); - /** * apm_cpu_idle - cpu idling for APM capable Linux * diff -puN arch/i386/mach-visws/reboot.c~kill-include-linux-platformh-default_idle-cleanup arch/i386/mach-visws/reboot.c --- devel/arch/i386/mach-visws/reboot.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/i386/mach-visws/reboot.c 2006-02-21 19:19:47.000000000 -0800 @@ -1,7 +1,6 @@ #include #include #include -#include #include #include "piix4.h" diff -puN arch/ia64/kernel/setup.c~kill-include-linux-platformh-default_idle-cleanup arch/ia64/kernel/setup.c --- devel/arch/ia64/kernel/setup.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/ia64/kernel/setup.c 2006-02-21 19:19:47.000000000 -0800 @@ -42,7 +42,6 @@ #include #include #include -#include #include #include diff -puN arch/m68k/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/m68k/kernel/process.c --- devel/arch/m68k/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/m68k/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -77,7 +77,7 @@ unsigned long thread_saved_pc(struct tas /* * The idle loop on an m68k.. */ -void default_idle(void) +static void default_idle(void) { if (!need_resched()) #if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES) diff -puN arch/m68knommu/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/m68knommu/kernel/process.c --- devel/arch/m68knommu/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/m68knommu/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -51,7 +51,7 @@ EXPORT_SYMBOL(pm_power_off); /* * The idle loop on an m68knommu.. */ -void default_idle(void) +static void default_idle(void) { local_irq_disable(); while (!need_resched()) { diff -puN arch/parisc/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/parisc/kernel/process.c --- devel/arch/parisc/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/parisc/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -54,11 +54,6 @@ #include #include -void default_idle(void) -{ - barrier(); -} - /* * The idle thread. There's no useful work to be * done, so just try to conserve power and have a diff -puN arch/s390/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/s390/kernel/process.c --- devel/arch/s390/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/s390/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -103,7 +103,7 @@ extern void s390_handle_mcck(void); /* * The idle loop on a S390... */ -void default_idle(void) +static void default_idle(void) { int cpu, rc; diff -puN arch/sh/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/sh/kernel/process.c --- devel/arch/sh/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/sh/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff -puN arch/sparc64/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/sparc64/kernel/process.c diff -puN arch/v850/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/v850/kernel/process.c --- devel/arch/v850/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/v850/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -34,7 +34,7 @@ extern void ret_from_fork (void); /* The idle loop. */ -void default_idle (void) +static void default_idle (void) { while (! need_resched ()) asm ("halt; nop; nop; nop; nop; nop" ::: "cc"); diff -puN arch/x86_64/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup arch/x86_64/kernel/process.c --- devel/arch/x86_64/kernel/process.c~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/arch/x86_64/kernel/process.c 2006-02-21 19:19:47.000000000 -0800 @@ -114,7 +114,7 @@ void exit_idle(void) * We use this if we don't have any better * idle routine.. */ -void default_idle(void) +static void default_idle(void) { local_irq_enable(); diff -puN include/asm-cris/system.h~kill-include-linux-platformh-default_idle-cleanup include/asm-cris/system.h --- devel/include/asm-cris/system.h~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/include/asm-cris/system.h 2006-02-21 19:19:47.000000000 -0800 @@ -71,4 +71,6 @@ static inline unsigned long __xchg(unsig #define arch_align_stack(x) (x) +void default_idle(void); + #endif diff -puN include/asm-i386/system.h~kill-include-linux-platformh-default_idle-cleanup include/asm-i386/system.h --- devel/include/asm-i386/system.h~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/include/asm-i386/system.h 2006-02-21 19:19:47.000000000 -0800 @@ -499,4 +499,6 @@ static inline void sched_cacheflush(void extern unsigned long arch_align_stack(unsigned long sp); extern void free_init_pages(char *what, unsigned long begin, unsigned long end); +void default_idle(void); + #endif diff -puN include/asm-ia64/system.h~kill-include-linux-platformh-default_idle-cleanup include/asm-ia64/system.h --- devel/include/asm-ia64/system.h~kill-include-linux-platformh-default_idle-cleanup 2006-02-21 19:19:47.000000000 -0800 +++ devel-akpm/include/asm-ia64/system.h 2006-02-21 19:19:47.000000000 -0800 @@ -265,6 +265,8 @@ void sched_cacheflush(void); #define arch_align_stack(x) (x) +void default_idle(void); + #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ diff -L include/linux/platform.h -puN include/linux/platform.h~kill-include-linux-platformh-default_idle-cleanup /dev/null --- devel/include/linux/platform.h +++ /dev/null 2003-09-15 06:40:47.000000000 -0700 @@ -1,43 +0,0 @@ -/* - * include/linux/platform.h - platform driver definitions - * - * Because of the prolific consumerism of the average American, - * and the dominant marketing budgets of PC OEMs, we have been - * blessed with frequent updates of the PC architecture. - * - * While most of these calls are singular per architecture, they - * require an extra layer of abstraction on the x86 so the right - * subsystem gets the right call. - * - * Basically, this consolidates the power off and reboot callbacks - * into one structure, as well as adding power management hooks. - * - * When adding a platform driver, please make sure all callbacks are - * filled. There are defaults defined below that do nothing; use those - * if you do not support that callback. - */ - -#ifndef _PLATFORM_H_ -#define _PLATFORM_H_ -#ifdef __KERNEL__ - -#include - -struct platform_t { - char * name; - u32 suspend_states; - void (*reboot)(char * cmd); - void (*halt)(void); - void (*power_off)(void); - int (*suspend)(int state, int flags); - void (*idle)(void); -}; - -extern struct platform_t * platform; -extern void default_reboot(char * cmd); -extern void default_halt(void); -extern int default_suspend(int state, int flags); -extern void default_idle(void); - -#endif /* __KERNEL__ */ -#endif /* _PLATFORM_H */ _