From: Andrey Panin Attached patch removes #ifdef CONFIG_WATCHDOG_NOWAYOUT mess duplicated in almost every watchdog driver and replaces it with common define in linux/watchdog.h. Signed-off-by: Andrey Panin Signed-off-by: Andrew Morton --- drivers/char/ipmi/ipmi_watchdog.c | 6 +----- drivers/char/watchdog/acquirewdt.c | 7 +------ drivers/char/watchdog/advantechwdt.c | 7 +------ drivers/char/watchdog/alim1535_wdt.c | 7 +------ drivers/char/watchdog/alim7101_wdt.c | 7 +------ drivers/char/watchdog/eurotechwdt.c | 7 +------ drivers/char/watchdog/i8xx_tco.c | 7 +------ drivers/char/watchdog/ib700wdt.c | 7 +------ drivers/char/watchdog/indydog.c | 7 +------ drivers/char/watchdog/ixp2000_wdt.c | 6 +----- drivers/char/watchdog/ixp4xx_wdt.c | 6 +----- drivers/char/watchdog/machzwd.c | 7 +------ drivers/char/watchdog/mixcomwd.c | 7 +------ drivers/char/watchdog/pcwd.c | 7 +------ drivers/char/watchdog/pcwd_pci.c | 7 +------ drivers/char/watchdog/pcwd_usb.c | 7 +------ drivers/char/watchdog/s3c2410_wdt.c | 7 +------ drivers/char/watchdog/sa1100_wdt.c | 6 +----- drivers/char/watchdog/sbc60xxwdt.c | 7 +------ drivers/char/watchdog/sc1200wdt.c | 7 +------ drivers/char/watchdog/sc520_wdt.c | 7 +------ drivers/char/watchdog/scx200_wdt.c | 6 +----- drivers/char/watchdog/shwdt.c | 6 +----- drivers/char/watchdog/softdog.c | 7 +------ drivers/char/watchdog/w83627hf_wdt.c | 7 +------ drivers/char/watchdog/w83877f_wdt.c | 7 +------ drivers/char/watchdog/wafer5823wdt.c | 7 +------ drivers/char/watchdog/wdt.c | 7 +------ drivers/char/watchdog/wdt977.c | 7 +------ drivers/char/watchdog/wdt_pci.c | 7 +------ drivers/s390/char/vmwatchdog.c | 6 +----- include/linux/watchdog.h | 10 ++++++++++ 32 files changed, 41 insertions(+), 179 deletions(-) diff -puN drivers/char/ipmi/ipmi_watchdog.c~consolidate-config_watchdog_nowayout-handling drivers/char/ipmi/ipmi_watchdog.c --- 25/drivers/char/ipmi/ipmi_watchdog.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/ipmi/ipmi_watchdog.c 2005-06-27 12:01:04.000000000 -0700 @@ -131,11 +131,7 @@ #define WDIOC_GET_PRETIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 22, int) #endif -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout; -#endif +static int nowayout = WATCHDOG_NOWAYOUT; static ipmi_user_t watchdog_user = NULL; diff -puN drivers/char/watchdog/acquirewdt.c~consolidate-config_watchdog_nowayout-handling drivers/char/watchdog/acquirewdt.c --- 25/drivers/char/watchdog/acquirewdt.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/watchdog/acquirewdt.c 2005-06-27 12:01:04.000000000 -0700 @@ -82,12 +82,7 @@ static int wdt_start = 0x443; module_param(wdt_start, int, 0); MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout = 0; -#endif - +static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); diff -puN drivers/char/watchdog/advantechwdt.c~consolidate-config_watchdog_nowayout-handling drivers/char/watchdog/advantechwdt.c --- 25/drivers/char/watchdog/advantechwdt.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/watchdog/advantechwdt.c 2005-06-27 12:01:04.000000000 -0700 @@ -73,12 +73,7 @@ static int timeout = WATCHDOG_TIMEOUT; / module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout = 0; -#endif - +static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); diff -puN drivers/char/watchdog/alim1535_wdt.c~consolidate-config_watchdog_nowayout-handling drivers/char/watchdog/alim1535_wdt.c --- 25/drivers/char/watchdog/alim1535_wdt.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/watchdog/alim1535_wdt.c 2005-06-27 12:01:04.000000000 -0700 @@ -38,12 +38,7 @@ static int timeout = WATCHDOG_TIMEOUT; module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0 #include -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout = 0; -#endif +static int nowayout = WATCHDOG_NOWAYOUT; static unsigned int heartbeat = 60; /* (secs) Default is 1 minute */ static unsigned long wdt_status; diff -puN drivers/char/watchdog/ixp4xx_wdt.c~consolidate-config_watchdog_nowayout-handling drivers/char/watchdog/ixp4xx_wdt.c --- 25/drivers/char/watchdog/ixp4xx_wdt.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/watchdog/ixp4xx_wdt.c 2005-06-27 12:01:04.000000000 -0700 @@ -27,11 +27,7 @@ #include #include -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout = 0; -#endif +static int nowayout = WATCHDOG_NOWAYOUT; static int heartbeat = 60; /* (secs) Default is 1 minute */ static unsigned long wdt_status; static unsigned long boot_status; diff -puN drivers/char/watchdog/machzwd.c~consolidate-config_watchdog_nowayout-handling drivers/char/watchdog/machzwd.c --- 25/drivers/char/watchdog/machzwd.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/watchdog/machzwd.c 2005-06-27 12:01:04.000000000 -0700 @@ -94,12 +94,7 @@ MODULE_DESCRIPTION("MachZ ZF-Logic Watch MODULE_LICENSE("GPL"); MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout = 0; -#endif - +static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); diff -puN drivers/char/watchdog/mixcomwd.c~consolidate-config_watchdog_nowayout-handling drivers/char/watchdog/mixcomwd.c --- 25/drivers/char/watchdog/mixcomwd.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/watchdog/mixcomwd.c 2005-06-27 12:01:04.000000000 -0700 @@ -62,12 +62,7 @@ static int mixcomwd_timer_alive; static struct timer_list mixcomwd_timer = TIMER_INITIALIZER(NULL, 0, 0); static char expect_close; -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout = 0; -#endif - +static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); diff -puN drivers/char/watchdog/pcwd.c~consolidate-config_watchdog_nowayout-handling drivers/char/watchdog/pcwd.c --- 25/drivers/char/watchdog/pcwd.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/watchdog/pcwd.c 2005-06-27 12:01:04.000000000 -0700 @@ -146,12 +146,7 @@ static int heartbeat = WATCHDOG_HEARTBEA module_param(heartbeat, int, 0); MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout = 0; -#endif - +static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); diff -puN drivers/char/watchdog/pcwd_pci.c~consolidate-config_watchdog_nowayout-handling drivers/char/watchdog/pcwd_pci.c --- 25/drivers/char/watchdog/pcwd_pci.c~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/drivers/char/watchdog/pcwd_pci.c 2005-06-27 12:01:04.000000000 -0700 @@ -103,12 +103,7 @@ static int heartbeat = WATCHDOG_HEARTBEA module_param(heartbeat, int, 0); MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0"); diff -puN include/linux/watchdog.h~consolidate-config_watchdog_nowayout-handling include/linux/watchdog.h --- 25/include/linux/watchdog.h~consolidate-config_watchdog_nowayout-handling 2005-06-27 12:01:04.000000000 -0700 +++ 25-akpm/include/linux/watchdog.h 2005-06-27 12:01:04.000000000 -0700 @@ -47,4 +47,14 @@ struct watchdog_info { #define WDIOS_ENABLECARD 0x0002 /* Turn on the watchdog timer */ #define WDIOS_TEMPPANIC 0x0004 /* Kernel panic on temperature trip */ +#ifdef __KERNEL__ + +#ifdef CONFIG_WATCHDOG_NOWAYOUT +#define WATCHDOG_NOWAYOUT 1 +#else +#define WATCHDOG_NOWAYOUT 0 +#endif + +#endif /* __KERNEL__ */ + #endif /* ifndef _LINUX_WATCHDOG_H */ _