From: Andrew Morton Coding style touchups.. "Calin A. Culianu" Signed-off-by: Andrew Morton --- drivers/char/watchdog/sbc_epx_c3.c | 88 +++++++++++++-------------- char/watchdog/Kconfig | 0 char/watchdog/Makefile | 0 3 files changed, 45 insertions(+), 43 deletions(-) diff -puN drivers/char/watchdog/Kconfig~watchdog-winsystems-epx-c3-sbc-tidy drivers/char/watchdog/Kconfig diff -puN drivers/char/watchdog/Makefile~watchdog-winsystems-epx-c3-sbc-tidy drivers/char/watchdog/Makefile diff -puN drivers/char/watchdog/sbc_epx_c3.c~watchdog-winsystems-epx-c3-sbc-tidy drivers/char/watchdog/sbc_epx_c3.c --- devel/drivers/char/watchdog/sbc_epx_c3.c~watchdog-winsystems-epx-c3-sbc-tidy 2006-01-13 21:06:46.000000000 -0800 +++ devel-akpm/drivers/char/watchdog/sbc_epx_c3.c 2006-01-13 21:06:46.000000000 -0800 @@ -1,7 +1,9 @@ /* - * SBC EPX C3 0.1 A Hardware Watchdog Device for the Winsystems EPX-C3 single board computer + * SBC EPX C3 0.1 A Hardware Watchdog Device for the Winsystems EPX-C3 + * single board computer * - * (c) Copyright 2006 Calin A. Culianu , All Rights Reserved. + * (c) Copyright 2006 Calin A. Culianu , 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 @@ -89,17 +91,17 @@ static int epx_c3_release(struct inode * return 0; } -static ssize_t epx_c3_write(struct file *file, const char *data, size_t len, loff_t *ppos) +static ssize_t epx_c3_write(struct file *file, const char *data, + size_t len, loff_t *ppos) { /* Refresh the timer. */ - if (len) { + if (len) epx_c3_pet(); - } return len; } static int epx_c3_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) + unsigned int cmd, unsigned long arg) { int options, retval = -EINVAL; static struct watchdog_info ident = { @@ -110,42 +112,42 @@ static int epx_c3_ioctl(struct inode *in }; switch (cmd) { - default: - return -ENOIOCTLCMD; - case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, - &ident, sizeof(ident))) - return -EFAULT; - return 0; - case WDIOC_GETSTATUS: - case WDIOC_GETBOOTSTATUS: - return put_user(0,(int *)arg); - case WDIOC_KEEPALIVE: - epx_c3_pet(); - return 0; - case WDIOC_GETTIMEOUT: - return put_user(WATCHDOG_TIMEOUT,(int *)arg); - case WDIOC_SETOPTIONS: - { - if (get_user(options, (int *)arg)) - return -EFAULT; - - if (options & WDIOS_DISABLECARD) { - epx_c3_stop(); - retval = 0; - } - - if (options & WDIOS_ENABLECARD) { - epx_c3_start(); - retval = 0; - } + case WDIOC_GETSUPPORT: + if (copy_to_user((struct watchdog_info *)arg, + &ident, sizeof(ident))) + return -EFAULT; + return 0; + case WDIOC_GETSTATUS: + case WDIOC_GETBOOTSTATUS: + return put_user(0,(int *)arg); + case WDIOC_KEEPALIVE: + epx_c3_pet(); + return 0; + case WDIOC_GETTIMEOUT: + return put_user(WATCHDOG_TIMEOUT,(int *)arg); + case WDIOC_SETOPTIONS: { + if (get_user(options, (int *)arg)) + return -EFAULT; + + if (options & WDIOS_DISABLECARD) { + epx_c3_stop(); + retval = 0; + } - return retval; + if (options & WDIOS_ENABLECARD) { + epx_c3_start(); + retval = 0; } + + return retval; + } + default: + return -ENOIOCTLCMD; } } -static int epx_c3_notify_sys(struct notifier_block *this, unsigned long code, void *unused) +static int epx_c3_notify_sys(struct notifier_block *this, unsigned long code, + void *unused) { if (code == SYS_DOWN || code == SYS_HALT) epx_c3_stop(); /* Turn the WDT off */ @@ -172,8 +174,8 @@ static struct notifier_block epx_c3_noti .notifier_call = epx_c3_notify_sys, }; -static char banner[] __initdata = - KERN_INFO PFX "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n"; +static const char banner[] __initdata = + KERN_INFO PFX "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n"; static int __init watchdog_init(void) { @@ -181,15 +183,15 @@ static int __init watchdog_init(void) ret = register_reboot_notifier(&epx_c3_notifier); if (ret) { - printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", - ret); + printk(KERN_ERR PFX "cannot register reboot notifier " + "(err=%d)\n", ret); return ret; } ret = misc_register(&epx_c3_miscdev); if (ret) { - printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", - WATCHDOG_MINOR, ret); + printk(KERN_ERR PFX "cannot register miscdev on minor=%d " + "(err=%d)\n", WATCHDOG_MINOR, ret); unregister_reboot_notifier(&epx_c3_notifier); return ret; } _