Skip to content

Commit

Permalink
[WATCHDOG] More coding-style and trivial clean-up
Browse files Browse the repository at this point in the history
Some more cleaning-up of the watchdog drivers.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Wim Van Sebroeck committed Mar 25, 2009
1 parent d5c26a5 commit 143a2e5
Show file tree
Hide file tree
Showing 34 changed files with 344 additions and 236 deletions.
8 changes: 4 additions & 4 deletions drivers/watchdog/acquirewdt.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Acquire Single Board Computer Watchdog Timer driver
*
* Based on wdt.c. Original copyright messages:
* Based on wdt.c. Original copyright messages:
*
* (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
* All Rights Reserved.
Expand All @@ -17,9 +17,9 @@
*
* (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>
*
* 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
* Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
* Can't add timeout - driver doesn't allow changing value
* 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
* Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
* Can't add timeout - driver doesn't allow changing value
*/

/*
Expand Down
7 changes: 5 additions & 2 deletions drivers/watchdog/advantechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
void __user *argp = (void __user *)arg;
int __user *p = argp;
static struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
.options = WDIOF_KEEPALIVEPING |
WDIOF_SETTIMEOUT |
WDIOF_MAGICCLOSE,
.firmware_version = 1,
.identity = WATCHDOG_NAME,
};
Expand Down Expand Up @@ -259,7 +261,8 @@ static int __devinit advwdt_probe(struct platform_device *dev)
goto unreg_stop;
}

/* Check that the heartbeat value is within it's range ; if not reset to the default */
/* Check that the heartbeat value is within it's range ;
* if not reset to the default */
if (advwdt_set_heartbeat(timeout)) {
advwdt_set_heartbeat(WATCHDOG_TIMEOUT);
printk(KERN_INFO PFX
Expand Down
20 changes: 10 additions & 10 deletions drivers/watchdog/alim1535_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void ali_start(void)

pci_read_config_dword(ali_pci, 0xCC, &val);
val &= ~0x3F; /* Mask count */
val |= (1<<25) | ali_timeout_bits;
val |= (1 << 25) | ali_timeout_bits;
pci_write_config_dword(ali_pci, 0xCC, val);

spin_unlock(&ali_lock);
Expand All @@ -79,8 +79,8 @@ static void ali_stop(void)
spin_lock(&ali_lock);

pci_read_config_dword(ali_pci, 0xCC, &val);
val &= ~0x3F; /* Mask count to zero (disabled) */
val &= ~(1<<25);/* and for safety mask the reset enable */
val &= ~0x3F; /* Mask count to zero (disabled) */
val &= ~(1 << 25); /* and for safety mask the reset enable */
pci_write_config_dword(ali_pci, 0xCC, val);

spin_unlock(&ali_lock);
Expand All @@ -89,7 +89,7 @@ static void ali_stop(void)
/*
* ali_keepalive - send a keepalive to the watchdog
*
* Send a keepalive to the timer (actually we restart the timer).
* Send a keepalive to the timer (actually we restart the timer).
*/

static void ali_keepalive(void)
Expand All @@ -109,11 +109,11 @@ static int ali_settimer(int t)
if (t < 0)
return -EINVAL;
else if (t < 60)
ali_timeout_bits = t|(1<<6);
ali_timeout_bits = t|(1 << 6);
else if (t < 3600)
ali_timeout_bits = (t/60)|(1<<7);
ali_timeout_bits = (t / 60)|(1 << 7);
else if (t < 18000)
ali_timeout_bits = (t/300)|(1<<6)|(1<<7);
ali_timeout_bits = (t / 300)|(1 << 6)|(1 << 7);
else
return -EINVAL;

Expand All @@ -138,7 +138,7 @@ static int ali_settimer(int t)
*/

static ssize_t ali_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
size_t len, loff_t *ppos)
{
/* See if we got the magic character 'V' and reload the timer */
if (len) {
Expand Down Expand Up @@ -348,9 +348,9 @@ static int __init ali_find_watchdog(void)
/* Timer bits */
wdog &= ~0x3F;
/* Issued events */
wdog &= ~((1<<27)|(1<<26)|(1<<25)|(1<<24));
wdog &= ~((1 << 27)|(1 << 26)|(1 << 25)|(1 << 24));
/* No monitor bits */
wdog &= ~((1<<16)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9));
wdog &= ~((1 << 16)|(1 << 13)|(1 << 12)|(1 << 11)|(1 << 10)|(1 << 9));

pci_write_config_dword(pdev, 0xCC, wdog);

Expand Down
6 changes: 4 additions & 2 deletions drivers/watchdog/alim7101_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ static int __init alim7101_wdt_init(void)
alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
NULL);
if (!alim7101_pmu) {
printk(KERN_INFO PFX "ALi M7101 PMU not present - WDT not set\n");
printk(KERN_INFO PFX
"ALi M7101 PMU not present - WDT not set\n");
return -EBUSY;
}

Expand Down Expand Up @@ -399,7 +400,8 @@ static int __init alim7101_wdt_init(void)

rc = misc_register(&wdt_miscdev);
if (rc) {
printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
printk(KERN_ERR PFX
"cannot register miscdev on minor=%d (err=%d)\n",
wdt_miscdev.minor, rc);
goto err_out_reboot;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/at91sam9_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static long at91_wdt_ioctl(struct file *file,
* Pat the watchdog whenever device is written to.
*/
static ssize_t at91_wdt_write(struct file *file, const char *data, size_t len,
loff_t *ppos)
loff_t *ppos)
{
if (!len)
return 0;
Expand Down
22 changes: 11 additions & 11 deletions drivers/watchdog/eurotechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
* Based on wdt.c.
* Original copyright messages:
*
* (c) Copyright 1996-1997 Alan Cox <alan@lxorguk.ukuu.org.uk>,
* (c) Copyright 1996-1997 Alan Cox <alan@lxorguk.ukuu.org.uk>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
* Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
*
* (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>*
* (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>*
*/

/* Changelog:
Expand All @@ -37,7 +37,7 @@
* add expect_close support
*
* 2002.05.30 - Joel Becker <joel.becker@oracle.com>
* Added Matt Domsch's nowayout module option.
* Added Matt Domsch's nowayout module option.
*/

/*
Expand Down Expand Up @@ -151,7 +151,7 @@ static void eurwdt_activate_timer(void)
if (irq == 0)
printk(KERN_INFO ": interrupt disabled\n");

eurwdt_write_reg(WDT_TIMER_CFG, irq<<4);
eurwdt_write_reg(WDT_TIMER_CFG, irq << 4);

eurwdt_write_reg(WDT_UNIT_SEL, WDT_UNIT_SECS); /* we use seconds */
eurwdt_set_timeout(0); /* the default timeout */
Expand Down
11 changes: 8 additions & 3 deletions drivers/watchdog/geodewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@

static int timeout = WATCHDOG_TIMEOUT;
module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=131, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
MODULE_PARM_DESC(timeout,
"Watchdog timeout in seconds. 1<= timeout <=131, default="
__MODULE_STRING(WATCHDOG_TIMEOUT) ".");

static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

static struct platform_device *geodewdt_platform_device;
static unsigned long wdt_flags;
Expand Down Expand Up @@ -269,7 +273,8 @@ static int __init geodewdt_init(void)
if (ret)
return ret;

geodewdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
geodewdt_platform_device = platform_device_register_simple(DRV_NAME,
-1, NULL, 0);
if (IS_ERR(geodewdt_platform_device)) {
ret = PTR_ERR(geodewdt_platform_device);
goto err;
Expand Down
3 changes: 2 additions & 1 deletion drivers/watchdog/hpwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ static struct pci_device_id hpwdt_devices[] = {
};
MODULE_DEVICE_TABLE(pci, hpwdt_devices);

extern asmlinkage void asminline_call(struct cmn_registers *pi86Regs, unsigned long *pRomEntry);
extern asmlinkage void asminline_call(struct cmn_registers *pi86Regs,
unsigned long *pRomEntry);

#ifndef CONFIG_X86_64
/* --32 Bit Bios------------------------------------------------------------ */
Expand Down
3 changes: 2 additions & 1 deletion drivers/watchdog/i6300esb.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ static ssize_t esb_write(struct file *file, const char __user *data,
* five months ago... */
esb_expect_close = 0;

/* scan to see whether or not we got the magic character */
/* scan to see whether or not we got the
* magic character */
for (i = 0; i != len; i++) {
char c;
if (get_user(c, data + i))
Expand Down
6 changes: 4 additions & 2 deletions drivers/watchdog/iTCO_vendor_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@

static int vendorsupport;
module_param(vendorsupport, int, 0);
MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=0 (none), 1=SuperMicro Pent3, 2=SuperMicro Pent4+");
MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default="
"0 (none), 1=SuperMicro Pent3, 2=SuperMicro Pent4+");

/*
* Vendor Specific Support
Expand Down Expand Up @@ -305,7 +306,8 @@ static void __exit iTCO_vendor_exit_module(void)
module_init(iTCO_vendor_init_module);
module_exit(iTCO_vendor_exit_module);

MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>, R. Seretny <lkpatches@paypc.com>");
MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>, "
"R. Seretny <lkpatches@paypc.com>");
MODULE_DESCRIPTION("Intel TCO Vendor Specific WatchDog Timer Driver Support");
MODULE_VERSION(DRV_VERSION);
MODULE_LICENSE("GPL");
Expand Down
15 changes: 10 additions & 5 deletions drivers/watchdog/iTCO_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ static struct platform_device *iTCO_wdt_platform_device;
#define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */
static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. "
"(2<heartbeat<39 (TCO v1) or 613 (TCO v2), default="
__MODULE_STRING(WATCHDOG_HEARTBEAT) ")");

static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0);
Expand Down Expand Up @@ -346,7 +348,8 @@ static int iTCO_wdt_start(void)
/* disable chipset's NO_REBOOT bit */
if (iTCO_wdt_unset_NO_REBOOT_bit()) {
spin_unlock(&iTCO_wdt_private.io_lock);
printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, "
"reboot disabled by hardware\n");
return -EIO;
}

Expand Down Expand Up @@ -669,7 +672,8 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,

/* Check chipset's NO_REBOOT bit */
if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) {
printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, "
"reboot disabled by hardware\n");
ret = -ENODEV; /* Cannot reset NO_REBOOT bit */
goto out;
}
Expand Down Expand Up @@ -716,8 +720,9 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
if not reset to the default */
if (iTCO_wdt_set_heartbeat(heartbeat)) {
iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT);
printk(KERN_INFO PFX "heartbeat value must be 2 < heartbeat < 39 (TCO v1) or 613 (TCO v2), using %d\n",
heartbeat);
printk(KERN_INFO PFX
"heartbeat value must be 2 < heartbeat < 39 (TCO v1) "
"or 613 (TCO v2), using %d\n", heartbeat);
}

ret = misc_register(&iTCO_wdt_miscdev);
Expand Down
12 changes: 6 additions & 6 deletions drivers/watchdog/it87_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ static inline int superio_inb(int reg)

static inline void superio_outb(int val, int reg)
{
outb(reg, REG);
outb(val, VAL);
outb(reg, REG);
outb(val, VAL);
}

static inline int superio_inw(int reg)
Expand All @@ -204,10 +204,10 @@ static inline int superio_inw(int reg)

static inline void superio_outw(int val, int reg)
{
outb(reg++, REG);
outb(val >> 8, VAL);
outb(reg, REG);
outb(val, VAL);
outb(reg++, REG);
outb(val >> 8, VAL);
outb(reg, REG);
outb(val, VAL);
}

/* watchdog timer handling */
Expand Down
4 changes: 2 additions & 2 deletions drivers/watchdog/mpc5200_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <asm/mpc52xx.h>


#define GPT_MODE_WDT (1<<15)
#define GPT_MODE_CE (1<<12)
#define GPT_MODE_WDT (1 << 15)
#define GPT_MODE_CE (1 << 12)
#define GPT_MODE_MS_TIMER (0x4)


Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/mpcore_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Based on the SoftDog driver:
* (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
* All Rights Reserved.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/mtx-1_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* All Rights Reserved.
* http://www.4g-systems.biz
*
* (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org>
* (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down
6 changes: 4 additions & 2 deletions drivers/watchdog/pc87413_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ static int __init pc87413_init(void)

ret = misc_register(&pc87413_miscdev);
if (ret != 0) {
printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
printk(KERN_ERR PFX
"cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
unregister_reboot_notifier(&pc87413_notifier);
return ret;
Expand Down Expand Up @@ -574,7 +575,8 @@ static void __exit pc87413_exit(void)
module_init(pc87413_init);
module_exit(pc87413_exit);

MODULE_AUTHOR("Sven Anders <anders@anduras.de>, Marcus Junker <junker@anduras.de>,");
MODULE_AUTHOR("Sven Anders <anders@anduras.de>, "
"Marcus Junker <junker@anduras.de>,");
MODULE_DESCRIPTION("PC87413 WDT driver");
MODULE_LICENSE("GPL");

Expand Down
Loading

0 comments on commit 143a2e5

Please sign in to comment.