Commit 3420f6b4 authored by Gustavo Silva's avatar Gustavo Silva Committed by Greg Kroah-Hartman

Staging: comedi: drivers: fix coding style issues in quatech_daqp_cs.c

This is a patch to the quatech_daqp_cs.c file that fixes up the following
issues:

ERROR: code indent should use tabs where possible		   x  1
WARNING: line over 80 characters				   x  1
WARNING: braces {} are not necessary for single statement blocks   x 10
WARNING: printk() should include KERN_ facility level		   x  6
Signed-off-by: default avatarGustavo Silva <silvagustavo@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8b83e005
...@@ -195,7 +195,7 @@ static struct comedi_driver driver_daqp = { ...@@ -195,7 +195,7 @@ static struct comedi_driver driver_daqp = {
static void daqp_dump(struct comedi_device *dev) static void daqp_dump(struct comedi_device *dev)
{ {
printk("DAQP: status %02x; aux status %02x\n", printk(KERN_INFO "DAQP: status %02x; aux status %02x\n",
inb(dev->iobase + DAQP_STATUS), inb(dev->iobase + DAQP_AUX)); inb(dev->iobase + DAQP_STATUS), inb(dev->iobase + DAQP_AUX));
} }
...@@ -207,9 +207,9 @@ static void hex_dump(char *str, void *ptr, int len) ...@@ -207,9 +207,9 @@ static void hex_dump(char *str, void *ptr, int len)
printk(str); printk(str);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
if (i % 16 == 0) { if (i % 16 == 0)
printk("\n0x%08x:", (unsigned int)cptr); printk("\n0x%08x:", (unsigned int)cptr);
}
printk(" %02x", *(cptr++)); printk(" %02x", *(cptr++));
} }
printk("\n"); printk("\n");
...@@ -223,9 +223,9 @@ static int daqp_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -223,9 +223,9 @@ static int daqp_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
struct local_info_t *local = (struct local_info_t *)s->private; struct local_info_t *local = (struct local_info_t *)s->private;
if (local->stop) { if (local->stop)
return -EIO; return -EIO;
}
outb(DAQP_COMMAND_STOP, dev->iobase + DAQP_COMMAND); outb(DAQP_COMMAND_STOP, dev->iobase + DAQP_COMMAND);
...@@ -355,9 +355,9 @@ static int daqp_ai_insn_read(struct comedi_device *dev, ...@@ -355,9 +355,9 @@ static int daqp_ai_insn_read(struct comedi_device *dev,
int v; int v;
int counter = 10000; int counter = 10000;
if (local->stop) { if (local->stop)
return -EIO; return -EIO;
}
/* Stop any running conversion */ /* Stop any running conversion */
daqp_ai_cancel(dev, s); daqp_ai_cancel(dev, s);
...@@ -372,9 +372,9 @@ static int daqp_ai_insn_read(struct comedi_device *dev, ...@@ -372,9 +372,9 @@ static int daqp_ai_insn_read(struct comedi_device *dev,
v = DAQP_SCANLIST_CHANNEL(CR_CHAN(insn->chanspec)) v = DAQP_SCANLIST_CHANNEL(CR_CHAN(insn->chanspec))
| DAQP_SCANLIST_GAIN(CR_RANGE(insn->chanspec)); | DAQP_SCANLIST_GAIN(CR_RANGE(insn->chanspec));
if (CR_AREF(insn->chanspec) == AREF_DIFF) { if (CR_AREF(insn->chanspec) == AREF_DIFF)
v |= DAQP_SCANLIST_DIFFERENTIAL; v |= DAQP_SCANLIST_DIFFERENTIAL;
}
v |= DAQP_SCANLIST_START; v |= DAQP_SCANLIST_START;
...@@ -488,7 +488,10 @@ static int daqp_ai_cmdtest(struct comedi_device *dev, ...@@ -488,7 +488,10 @@ static int daqp_ai_cmdtest(struct comedi_device *dev,
if (err) if (err)
return 1; return 1;
/* step 2: make sure trigger sources are unique and mutually compatible */ /*
* step 2: make sure trigger sources
* are unique and mutually compatible
*/
/* note that mutual compatibility is not an issue here */ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_TIMER && if (cmd->scan_begin_src != TRIG_TIMER &&
...@@ -588,9 +591,9 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -588,9 +591,9 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
int i; int i;
int v; int v;
if (local->stop) { if (local->stop)
return -EIO; return -EIO;
}
/* Stop any running conversion */ /* Stop any running conversion */
daqp_ai_cancel(dev, s); daqp_ai_cancel(dev, s);
...@@ -640,13 +643,11 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -640,13 +643,11 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
v = DAQP_SCANLIST_CHANNEL(CR_CHAN(chanspec)) v = DAQP_SCANLIST_CHANNEL(CR_CHAN(chanspec))
| DAQP_SCANLIST_GAIN(CR_RANGE(chanspec)); | DAQP_SCANLIST_GAIN(CR_RANGE(chanspec));
if (CR_AREF(chanspec) == AREF_DIFF) { if (CR_AREF(chanspec) == AREF_DIFF)
v |= DAQP_SCANLIST_DIFFERENTIAL; v |= DAQP_SCANLIST_DIFFERENTIAL;
}
if (i == 0 || scanlist_start_on_every_entry) { if (i == 0 || scanlist_start_on_every_entry)
v |= DAQP_SCANLIST_START; v |= DAQP_SCANLIST_START;
}
outb(v & 0xff, dev->iobase + DAQP_SCANLIST); outb(v & 0xff, dev->iobase + DAQP_SCANLIST);
outb(v >> 8, dev->iobase + DAQP_SCANLIST); outb(v >> 8, dev->iobase + DAQP_SCANLIST);
...@@ -760,7 +761,8 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -760,7 +761,8 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
while (--counter while (--counter
&& (inb(dev->iobase + DAQP_STATUS) & DAQP_STATUS_EVENTS)) ; && (inb(dev->iobase + DAQP_STATUS) & DAQP_STATUS_EVENTS)) ;
if (!counter) { if (!counter) {
printk("daqp: couldn't clear interrupts in status register\n"); printk(KERN_ERR
"daqp: couldn't clear interrupts in status register\n");
return -1; return -1;
} }
...@@ -785,9 +787,8 @@ static int daqp_ao_insn_write(struct comedi_device *dev, ...@@ -785,9 +787,8 @@ static int daqp_ao_insn_write(struct comedi_device *dev,
int d; int d;
unsigned int chan; unsigned int chan;
if (local->stop) { if (local->stop)
return -EIO; return -EIO;
}
chan = CR_CHAN(insn->chanspec); chan = CR_CHAN(insn->chanspec);
d = data[0]; d = data[0];
...@@ -811,9 +812,8 @@ static int daqp_di_insn_read(struct comedi_device *dev, ...@@ -811,9 +812,8 @@ static int daqp_di_insn_read(struct comedi_device *dev,
{ {
struct local_info_t *local = (struct local_info_t *)s->private; struct local_info_t *local = (struct local_info_t *)s->private;
if (local->stop) { if (local->stop)
return -EIO; return -EIO;
}
data[0] = inb(dev->iobase + DAQP_DIGITAL_IO); data[0] = inb(dev->iobase + DAQP_DIGITAL_IO);
...@@ -828,9 +828,8 @@ static int daqp_do_insn_write(struct comedi_device *dev, ...@@ -828,9 +828,8 @@ static int daqp_do_insn_write(struct comedi_device *dev,
{ {
struct local_info_t *local = (struct local_info_t *)s->private; struct local_info_t *local = (struct local_info_t *)s->private;
if (local->stop) { if (local->stop)
return -EIO; return -EIO;
}
outw(data[0] & 0xf, dev->iobase + DAQP_DIGITAL_IO); outw(data[0] & 0xf, dev->iobase + DAQP_DIGITAL_IO);
...@@ -878,7 +877,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -878,7 +877,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret < 0) if (ret < 0)
return ret; return ret;
printk("comedi%d: attaching daqp%d (io 0x%04lx)\n", printk(KERN_INFO "comedi%d: attaching daqp%d (io 0x%04lx)\n",
dev->minor, it->options[0], dev->iobase); dev->minor, it->options[0], dev->iobase);
s = dev->subdevices + 0; s = dev->subdevices + 0;
...@@ -931,7 +930,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -931,7 +930,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int daqp_detach(struct comedi_device *dev) static int daqp_detach(struct comedi_device *dev)
{ {
printk("comedi%d: detaching daqp\n", dev->minor); printk(KERN_INFO "comedi%d: detaching daqp\n", dev->minor);
return 0; return 0;
} }
...@@ -1152,7 +1151,7 @@ static void daqp_cs_config(struct pcmcia_device *link) ...@@ -1152,7 +1151,7 @@ static void daqp_cs_config(struct pcmcia_device *link)
/* Finally, report what we've done */ /* Finally, report what we've done */
dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
if (link->conf.Attributes & CONF_ENABLE_IRQ) if (link->conf.Attributes & CONF_ENABLE_IRQ)
printk(", irq %u", link->irq); printk(KERN_INFO ", irq %u", link->irq);
if (link->io.NumPorts1) if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1, printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1); link->io.BasePort1 + link->io.NumPorts1 - 1);
......
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