Commit 7944d3a5 authored by Wim Van Sebroeck's avatar Wim Van Sebroeck
Browse files

[WATCHDOG] more coding style clean-up's


More coding style clean-up's.
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 12b7a152
......@@ -463,7 +463,7 @@ config PC87413_WDT
module will be called pc87413_wdt.
Most people will say N.
config 60XX_WDT
tristate "SBC-60XX Watchdog Timer"
depends on X86
......
......@@ -92,7 +92,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o
# MIPS Architecture
obj-$(CONFIG_INDYDOG) += indydog.o
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o
obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o
obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
......
......@@ -126,7 +126,7 @@ static ssize_t acq_write(struct file *file, const char __user *buf,
if (!nowayout) {
size_t i;
/* note: just in case someone wrote the magic character
* five months ago... */
five months ago... */
expect_close = 0;
/* scan to see whether or not we got the
magic character */
......
......@@ -47,7 +47,8 @@
#define WATCHDOG_NAME "Advantech WDT"
#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */
static struct platform_device *advwdt_platform_device; /* the watchdog platform device */
/* the watchdog platform device */
static struct platform_device *advwdt_platform_device;
static unsigned long advwdt_is_open;
static char adv_expect_close;
......@@ -120,7 +121,7 @@ static ssize_t advwdt_write(struct file *file, const char __user *buf,
for (i = 0; i != count; i++) {
char c;
if (get_user(c, buf+i))
if (get_user(c, buf + i))
return -EFAULT;
if (c == 'V')
adv_expect_close = 42;
......@@ -199,8 +200,7 @@ static int advwdt_open(struct inode *inode, struct file *file)
return nonseekable_open(inode, file);
}
static int
advwdt_close(struct inode *inode, struct file *file)
static int advwdt_close(struct inode *inode, struct file *file)
{
if (adv_expect_close == 42) {
advwdt_disable();
......@@ -288,9 +288,9 @@ static int __devinit advwdt_probe(struct platform_device *dev)
static int __devexit advwdt_remove(struct platform_device *dev)
{
misc_deregister(&advwdt_miscdev);
release_region(wdt_start,1);
if(wdt_stop != wdt_start)
release_region(wdt_stop,1);
release_region(wdt_start, 1);
if (wdt_stop != wdt_start)
release_region(wdt_stop, 1);
return 0;
}
......@@ -315,7 +315,8 @@ static int __init advwdt_init(void)
{
int err;
printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n");
printk(KERN_INFO
"WDT driver for Advantech single board computer initialising.\n");
err = platform_driver_register(&advwdt_driver);
if (err)
......
......@@ -153,7 +153,7 @@ static ssize_t ali_write(struct file *file, const char __user *data,
the magic character */
for (i = 0; i != len; i++) {
char c;
if (get_user(c, data+i))
if (get_user(c, data + i))
return -EFAULT;
if (c == 'V')
ali_expect_release = 42;
......
......@@ -125,7 +125,7 @@ static void wdt_timer_ping(unsigned long data)
static void wdt_change(int writeval)
{
char tmp;
char tmp;
pci_read_config_byte(alim7101_pmu, ALI_7101_WDT, &tmp);
if (writeval == WDT_ENABLE) {
......@@ -198,7 +198,7 @@ static ssize_t fop_write(struct file *file, const char __user *buf,
/* now scan */
for (ofs = 0; ofs != count; ofs++) {
char c;
if (get_user(c, buf+ofs))
if (get_user(c, buf + ofs))
return -EFAULT;
if (c == 'V')
wdt_expect_close = 42;
......
......@@ -213,7 +213,7 @@ static int ar7_wdt_notify_sys(struct notifier_block *this,
}
static struct notifier_block ar7_wdt_notifier = {
.notifier_call = ar7_wdt_notify_sys
.notifier_call = ar7_wdt_notify_sys,
};
static ssize_t ar7_wdt_write(struct file *file, const char *data,
......@@ -230,7 +230,7 @@ static ssize_t ar7_wdt_write(struct file *file, const char *data,
expect_close = 0;
for (i = 0; i < len; ++i) {
char c;
if (get_user(c, data+i))
if (get_user(c, data + i))
return -EFAULT;
if (c == 'V')
expect_close = 1;
......
......@@ -283,7 +283,7 @@ static ssize_t at32_wdt_write(struct file *file, const char __user *data,
*/
for (i = 0; i != len; i++) {
char c;
if (get_user(c, data+i))
if (get_user(c, data + i))
return -EFAULT;
if (c == 'V')
expect_release = 42;
......
......@@ -210,7 +210,7 @@ size_t count, loff_t *ppos)
for (i = 0; i != count; i++) {
char c;
if (get_user(c, buf+i))
if (get_user(c, buf + i))
return -EFAULT;
if (c == 'V')
eur_expect_close = 42;
......@@ -360,10 +360,8 @@ static int eurwdt_release(struct inode *inode, struct file *file)
static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT) {
/* Turn the card off */
eurwdt_disable_timer();
}
if (code == SYS_DOWN || code == SYS_HALT)
eurwdt_disable_timer(); /* Turn the card off */
return NOTIFY_DONE;
}
......
......@@ -77,27 +77,24 @@ static int geodewdt_set_heartbeat(int val)
return 0;
}
static int
geodewdt_open(struct inode *inode, struct file *file)
static int geodewdt_open(struct inode *inode, struct file *file)
{
if (test_and_set_bit(WDT_FLAGS_OPEN, &wdt_flags))
return -EBUSY;
if (test_and_set_bit(WDT_FLAGS_OPEN, &wdt_flags))
return -EBUSY;
if (!test_and_clear_bit(WDT_FLAGS_ORPHAN, &wdt_flags))
__module_get(THIS_MODULE);
if (!test_and_clear_bit(WDT_FLAGS_ORPHAN, &wdt_flags))
__module_get(THIS_MODULE);
geodewdt_ping();
return nonseekable_open(inode, file);
return nonseekable_open(inode, file);
}
static int
geodewdt_release(struct inode *inode, struct file *file)
static int geodewdt_release(struct inode *inode, struct file *file)
{
if (safe_close) {
geodewdt_disable();
module_put(THIS_MODULE);
}
else {
} else {
printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n");
geodewdt_ping();
......@@ -109,11 +106,10 @@ geodewdt_release(struct inode *inode, struct file *file)
return 0;
}
static ssize_t
geodewdt_write(struct file *file, const char __user *data, size_t len,
loff_t *ppos)
static ssize_t geodewdt_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{
if(len) {
if (len) {
if (!nowayout) {
size_t i;
safe_close = 0;
......@@ -134,9 +130,8 @@ geodewdt_write(struct file *file, const char __user *data, size_t len,
return len;
}
static int
geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
static int geodewdt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
void __user *argp = (void __user *)arg;
int __user *p = argp;
......@@ -147,7 +142,7 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
| WDIOF_MAGICCLOSE,
.firmware_version = 1,
.identity = WATCHDOG_NAME,
};
};
switch (cmd) {
case WDIOC_GETSUPPORT:
......@@ -200,22 +195,21 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}
static const struct file_operations geodewdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = geodewdt_write,
.ioctl = geodewdt_ioctl,
.open = geodewdt_open,
.release = geodewdt_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = geodewdt_write,
.ioctl = geodewdt_ioctl,
.open = geodewdt_open,
.release = geodewdt_release,
};
static struct miscdevice geodewdt_miscdev = {
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &geodewdt_fops
.fops = &geodewdt_fops,
};
static int __devinit
geodewdt_probe(struct platform_device *dev)
static int __devinit geodewdt_probe(struct platform_device *dev)
{
int ret, timer;
......@@ -246,15 +240,13 @@ geodewdt_probe(struct platform_device *dev)
return ret;
}
static int __devexit
geodewdt_remove(struct platform_device *dev)
static int __devexit geodewdt_remove(struct platform_device *dev)
{
misc_deregister(&geodewdt_miscdev);
return 0;
}
static void
geodewdt_shutdown(struct platform_device *dev)
static void geodewdt_shutdown(struct platform_device *dev)
{
geodewdt_disable();
}
......@@ -269,8 +261,7 @@ static struct platform_driver geodewdt_driver = {
},
};
static int __init
geodewdt_init(void)
static int __init geodewdt_init(void)
{
int ret;
......@@ -290,8 +281,7 @@ geodewdt_init(void)
return ret;
}
static void __exit
geodewdt_exit(void)
static void __exit geodewdt_exit(void)
{
platform_device_unregister(geodewdt_platform_device);
platform_driver_unregister(&geodewdt_driver);
......
......@@ -405,7 +405,7 @@ static int __devinit detect_cru_service(void)
dmi_walk(dmi_find_cru);
/* if cru_rom_addr has been set then we found a CRU service */
return ((cru_rom_addr != NULL)? 0: -ENODEV);
return ((cru_rom_addr != NULL) ? 0: -ENODEV);
}
/* ------------------------------------------------------------------------- */
......@@ -533,7 +533,7 @@ static ssize_t hpwdt_write(struct file *file, const char __user *data,
/* scan to see whether or not we got the magic char. */
for (i = 0; i != len; i++) {
char c;
if (get_user(c, data+i))
if (get_user(c, data + i))
return -EFAULT;
if (c == 'V')
expect_release = 42;
......
......@@ -9,18 +9,18 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* based on i810-tco.c which is in turn based on softdog.c
* based on i810-tco.c which is in turn based on softdog.c
*
* The timer is implemented in the following I/O controller hubs:
* (See the intel documentation on http://developer.intel.com.)
* 6300ESB chip : document number 300641-003
* The timer is implemented in the following I/O controller hubs:
* (See the intel documentation on http://developer.intel.com.)
* 6300ESB chip : document number 300641-003
*
* 2004YYZZ Ross Biro
* Initial version 0.01
* 2004YYZZ Ross Biro
* Version 0.02
* Version 0.02
* 20050210 David Härdeman <david@2gen.com>
* Ported driver to kernel 2.6
* Ported driver to kernel 2.6
*/
/*
......@@ -108,7 +108,8 @@ MODULE_PARM_DESC(nowayout,
* reload register. After this the appropriate registers can be written
* to once before they need to be unlocked again.
*/
static inline void esb_unlock_registers(void) {
static inline void esb_unlock_registers(void)
{
writeb(ESB_UNLOCK1, ESB_RELOAD_REG);
writeb(ESB_UNLOCK2, ESB_RELOAD_REG);
}
......@@ -169,7 +170,7 @@ static int esb_timer_set_heartbeat(int time)
/* Write timer 2 */
esb_unlock_registers();
writel(val, ESB_TIMER2_REG);
writel(val, ESB_TIMER2_REG);
/* Reload */
esb_unlock_registers();
......@@ -196,7 +197,7 @@ static int esb_timer_read(void)
}
/*
* /dev/watchdog handling
* /dev/watchdog handling
*/
static int esb_open(struct inode *inode, struct file *file)
......@@ -242,7 +243,7 @@ static ssize_t esb_write(struct file *file, const char __user *data,
/* 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))
if (get_user(c, data + i))
return -EFAULT;
if (c == 'V')
esb_expect_close = 42;
......@@ -262,11 +263,11 @@ static long esb_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_SETTIMEOUT |
.options = WDIOF_SETTIMEOUT |
WDIOF_KEEPALIVEPING |
WDIOF_MAGICCLOSE,
.firmware_version = 0,
.identity = ESB_MODULE_NAME,
.firmware_version = 0,
.identity = ESB_MODULE_NAME,
};
switch (cmd) {
......@@ -324,10 +325,9 @@ static long esb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static int esb_notify_sys(struct notifier_block *this,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT) {
/* Turn the WDT off */
esb_timer_stop();
}
if (code == SYS_DOWN || code == SYS_HALT)
esb_timer_stop(); /* Turn the WDT off */
return NOTIFY_DONE;
}
......
......@@ -18,9 +18,9 @@
*/
/* Module and version information */
#define DRV_NAME "iTCO_vendor_support"
#define DRV_VERSION "1.01"
#define DRV_RELDATE "11-Nov-2006"
#define DRV_NAME "iTCO_vendor_support"
#define DRV_VERSION "1.01"
#define DRV_RELDATE "11-Nov-2006"
#define PFX DRV_NAME ": "
/* Includes */
......@@ -37,8 +37,8 @@
/* iTCO defines */
#define SMI_EN acpibase + 0x30 /* SMI Control and Enable Register */
#define TCOBASE acpibase + 0x60 /* TCO base address */
#define TCO1_STS TCOBASE + 0x04 /* TCO1 Status Register */
#define TCOBASE acpibase + 0x60 /* TCO base address */
#define TCO1_STS TCOBASE + 0x04 /* TCO1 Status Register */
/* List of vendor support modes */
/* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */
......
......@@ -55,9 +55,9 @@
*/
/* Module and version information */
#define DRV_NAME "iTCO_wdt"
#define DRV_VERSION "1.03"
#define DRV_RELDATE "30-Apr-2008"
#define DRV_NAME "iTCO_wdt"
#define DRV_VERSION "1.03"
#define DRV_RELDATE "30-Apr-2008"
#define PFX DRV_NAME ": "
/* Includes */
......@@ -107,7 +107,7 @@ enum iTCO_chipsets {
TCO_ICH9, /* ICH9 */
TCO_ICH9R, /* ICH9R */
TCO_ICH9DH, /* ICH9DH */
TCO_ICH9DO, /* ICH9DO */
TCO_ICH9DO, /* ICH9DO */
TCO_631XESB, /* 631xESB/632xESB */
};
......@@ -497,7 +497,7 @@ static ssize_t iTCO_wdt_write(struct file *file, const char __user *data,
magic character */
for (i = 0; i != len; i++) {
char c;
if (get_user(c, data+i))
if (get_user(c, data + i))
return -EFAULT;
if (c == 'V')
expect_release = 42;
......
......@@ -129,8 +129,7 @@ MODULE_PARM_DESC(nowayout,
* Watchdog Operations
*/
static void
ibwdt_ping(void)
static void ibwdt_ping(void)
{
spin_lock(&ibwdt_lock);
......@@ -140,16 +139,14 @@ ibwdt_ping(void)
spin_unlock(&ibwdt_lock);
}
static void
ibwdt_disable(void)
static void ibwdt_disable(void)
{
spin_lock(&ibwdt_lock);
outb_p(0, WDT_STOP);
spin_unlock(&ibwdt_lock);
}
static int
ibwdt_set_heartbeat(int t)
static int ibwdt_set_heartbeat(int t)
{
int i;
......@@ -263,8 +260,7 @@ static int ibwdt_open(struct inode *inode, struct file *file)
return nonseekable_open(inode, file);
}
static int
ibwdt_close(struct inode *inode, struct file *file)
static int ibwdt_close(struct inode *inode, struct file *file)
{
if (expect_close == 42) {
ibwdt_disable();
......
......@@ -275,7 +275,7 @@ static long asr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static const struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING |
WDIOF_MAGICCLOSE,
.identity = "IBM ASR"
.identity = "IBM ASR",
};
void __user *argp = (void __user *)arg;
int __user *p = argp;
......@@ -345,7 +345,7 @@ static int asr_release(struct inode *inode, struct file *file)
static const struct file_operations asr_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.llseek = no_llseek,
.write = asr_write,
.unlocked_ioctl = asr_ioctl,
.open = asr_open,
......
......@@ -241,7 +241,7 @@ static int __init iop_wdt_init(void)
with an open */
ret = misc_register(&iop_wdt_miscdev);
if (ret == 0)
printk("iop watchdog timer: timeout %lu sec\n",
printk(KERN_INFO "iop watchdog timer: timeout %lu sec\n",
iop_watchdog_timeout());
return ret;
......
......@@ -221,7 +221,7 @@ static ssize_t it8712f_wdt_write(struct file *file, const char __user *data,
expect_close = 0;
for (i = 0; i < len; ++i) {
char c;
if (get_user(c, data+i))
if (get_user(c, data + i))
return -EFAULT;
if (c == 'V')
expect_close = 42;
......
......@@ -157,8 +157,7 @@ static int ixp4xx_wdt_release(struct inode *inode, struct file *file)
}
static const struct file_operations ixp4xx_wdt_fops =
{
static const struct file_operations ixp4xx_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = ixp4xx_wdt_write,
......@@ -167,8 +166,7 @@ static const struct file_operations ixp4xx_wdt_fops =
.release = ixp4xx_wdt_release,
};
static struct miscdevice ixp4xx_wdt_miscdev =
{
static struct miscdevice ixp4xx_wdt_miscdev = {
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &ixp4xx_wdt_fops,
......@@ -181,8 +179,8 @@ static int __init ixp4xx_wdt_init(void)
asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
if (!(processor_id & 0xf) && !cpu_is_ixp46x()) {
printk("IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected - "
"watchdog disabled\n");
printk(KERN_ERR "IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected"
" - watchdog disabled\n");
return -ENODEV;
}
......@@ -191,7 +189,8 @@ static int __init ixp4xx_wdt_init(void)
WDIOF_CARDRESET : 0;
ret = misc_register(&ixp4xx_wdt_miscdev);
if (ret == 0)
printk("IXP4xx Watchdog Timer: heartbeat %d sec\n", heartbeat);
printk(KERN_INFO "IXP4xx Watchdog Timer: heartbeat %d sec\n",
heartbeat);
return ret;
}
......
......@@ -164,7 +164,7 @@ static int mpc5200_wdt_release(struct inode *inode, struct file *file)
static const struct file_operations mpc5200_wdt_fops = {
.owner = THIS_MODULE,
.write = mpc5200_wdt_write,
.ioctl = mpc5200_wdt_ioctl,
.unlocked_ioctl = mpc5200_wdt_ioctl,
.open = mpc5200_wdt_open,
.release = mpc5200_wdt_release,
};
......@@ -219,9 +219,9 @@ static int mpc5200_wdt_probe(struct of_device *op,
return 0;
iounmap(wdt->regs);
out_release:
out_release:
release_mem_region(wdt->mem.start, size);
out_free:
out_free:
kfree(wdt);
return err;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment