Commit 927d6961 authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] cpwd.c: Coding style - Clean-up

This brings the cpwd.c watchdog driver in line with the kernel's coding style.
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent d8100c3a
...@@ -108,7 +108,8 @@ static struct cpwd *cpwd_device; ...@@ -108,7 +108,8 @@ static struct cpwd *cpwd_device;
* ------------------- * -------------------
* dcntr - Current 16-bit downcounter value. * dcntr - Current 16-bit downcounter value.
* When downcounter reaches '0' watchdog expires. * When downcounter reaches '0' watchdog expires.
* Reading this register resets downcounter with 'limit' value. * Reading this register resets downcounter with
* 'limit' value.
* limit - 16-bit countdown value in 1/10th second increments. * limit - 16-bit countdown value in 1/10th second increments.
* Writing this register begins countdown with input value. * Writing this register begins countdown with input value.
* Reading from this register does not affect counter. * Reading from this register does not affect counter.
...@@ -158,11 +159,11 @@ static int wd0_timeout = 0; ...@@ -158,11 +159,11 @@ static int wd0_timeout = 0;
static int wd1_timeout = 0; static int wd1_timeout = 0;
static int wd2_timeout = 0; static int wd2_timeout = 0;
module_param (wd0_timeout, int, 0); module_param(wd0_timeout, int, 0);
MODULE_PARM_DESC(wd0_timeout, "Default watchdog0 timeout in 1/10secs"); MODULE_PARM_DESC(wd0_timeout, "Default watchdog0 timeout in 1/10secs");
module_param (wd1_timeout, int, 0); module_param(wd1_timeout, int, 0);
MODULE_PARM_DESC(wd1_timeout, "Default watchdog1 timeout in 1/10secs"); MODULE_PARM_DESC(wd1_timeout, "Default watchdog1 timeout in 1/10secs");
module_param (wd2_timeout, int, 0); module_param(wd2_timeout, int, 0);
MODULE_PARM_DESC(wd2_timeout, "Default watchdog2 timeout in 1/10secs"); MODULE_PARM_DESC(wd2_timeout, "Default watchdog2 timeout in 1/10secs");
MODULE_AUTHOR("Eric Brower <ebrower@usa.net>"); MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
...@@ -309,7 +310,7 @@ static int cpwd_getstatus(struct cpwd *p, int index) ...@@ -309,7 +310,7 @@ static int cpwd_getstatus(struct cpwd *p, int index)
/* determine EXPIRED vs FREERUN vs RUNNING */ /* determine EXPIRED vs FREERUN vs RUNNING */
else if (WD_S_EXPIRED & stat) { else if (WD_S_EXPIRED & stat) {
ret = WD_EXPIRED; ret = WD_EXPIRED;
} else if(WD_S_RUNNING & stat) { } else if (WD_S_RUNNING & stat) {
if (intr & p->devs[index].intr_mask) { if (intr & p->devs[index].intr_mask) {
ret = WD_FREERUN; ret = WD_FREERUN;
} else { } else {
...@@ -329,7 +330,8 @@ static int cpwd_getstatus(struct cpwd *p, int index) ...@@ -329,7 +330,8 @@ static int cpwd_getstatus(struct cpwd *p, int index)
if (p->devs[index].runstatus & WD_STAT_SVCD) { if (p->devs[index].runstatus & WD_STAT_SVCD) {
ret = WD_EXPIRED; ret = WD_EXPIRED;
} else { } else {
/* we could as well pretend we are expired */ /* we could as well pretend
* we are expired */
ret = WD_FREERUN; ret = WD_FREERUN;
} }
} else { } else {
...@@ -342,7 +344,7 @@ static int cpwd_getstatus(struct cpwd *p, int index) ...@@ -342,7 +344,7 @@ static int cpwd_getstatus(struct cpwd *p, int index)
if (p->devs[index].runstatus & WD_STAT_SVCD) if (p->devs[index].runstatus & WD_STAT_SVCD)
ret |= WD_SERVICED; ret |= WD_SERVICED;
return(ret); return ret;
} }
static irqreturn_t cpwd_interrupt(int irq, void *dev_id) static irqreturn_t cpwd_interrupt(int irq, void *dev_id)
...@@ -367,7 +369,7 @@ static int cpwd_open(struct inode *inode, struct file *f) ...@@ -367,7 +369,7 @@ static int cpwd_open(struct inode *inode, struct file *f)
struct cpwd *p = cpwd_device; struct cpwd *p = cpwd_device;
lock_kernel(); lock_kernel();
switch(iminor(inode)) { switch (iminor(inode)) {
case WD0_MINOR: case WD0_MINOR:
case WD1_MINOR: case WD1_MINOR:
case WD2_MINOR: case WD2_MINOR:
...@@ -458,7 +460,7 @@ static long cpwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -458,7 +460,7 @@ static long cpwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case WIOCSTOP: case WIOCSTOP:
if (p->enabled) if (p->enabled)
return(-EINVAL); return -EINVAL;
cpwd_stoptimer(p, index); cpwd_stoptimer(p, index);
break; break;
...@@ -508,7 +510,7 @@ static ssize_t cpwd_write(struct file *file, const char __user *buf, ...@@ -508,7 +510,7 @@ static ssize_t cpwd_write(struct file *file, const char __user *buf,
return 0; return 0;
} }
static ssize_t cpwd_read(struct file * file, char __user *buffer, static ssize_t cpwd_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
return -EINVAL; return -EINVAL;
......
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