Staging: comedi: Fix checpatch.pl issues in file rtd520.c

This patch fixes the checkpatch errors listed below:

ERROR: code indent should use tabs where possible
WARNING: space prohibited between function name and open parenthesis '('
WARNING: please, no spaces at the start of a line
WARNING: braces {} are not necessary for single statement blocks
WARNING: printk() should include KERN_ facility level

Signed-off-by: Nick Robinson <nr33@msstate.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Nick Robinson 2011-01-31 10:56:50 -06:00 committed by Greg Kroah-Hartman
parent e80528b78e
commit bc8bf90a64

View file

@ -760,7 +760,7 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
int index; int index;
#endif #endif
printk("comedi%d: rtd520 attaching.\n", dev->minor); printk(KERN_INFO "comedi%d: rtd520 attaching.\n", dev->minor);
#if defined(CONFIG_COMEDI_DEBUG) && defined(USE_DMA) #if defined(CONFIG_COMEDI_DEBUG) && defined(USE_DMA)
/* You can set this a load time: modprobe comedi comedi_debug=1 */ /* You can set this a load time: modprobe comedi comedi_debug=1 */
@ -800,10 +800,10 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
if (!pcidev) { if (!pcidev) {
if (it->options[0] && it->options[1]) { if (it->options[0] && it->options[1]) {
printk("No RTD card at bus=%d slot=%d.\n", printk(KERN_INFO "No RTD card at bus=%d slot=%d.\n",
it->options[0], it->options[1]); it->options[0], it->options[1]);
} else { } else {
printk("No RTD card found.\n"); printk(KERN_INFO "No RTD card found.\n");
} }
return -EIO; return -EIO;
} }
@ -812,7 +812,7 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
ret = comedi_pci_enable(pcidev, DRV_NAME); ret = comedi_pci_enable(pcidev, DRV_NAME);
if (ret < 0) { if (ret < 0) {
printk("Failed to enable PCI device and request regions.\n"); printk(KERN_INFO "Failed to enable PCI device and request regions.\n");
return ret; return ret;
} }
devpriv->got_regions = 1; devpriv->got_regions = 1;
@ -830,9 +830,9 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->las1 = ioremap_nocache(physLas1, LAS1_PCISIZE); devpriv->las1 = ioremap_nocache(physLas1, LAS1_PCISIZE);
devpriv->lcfg = ioremap_nocache(physLcfg, LCFG_PCISIZE); devpriv->lcfg = ioremap_nocache(physLcfg, LCFG_PCISIZE);
if (!devpriv->las0 || !devpriv->las1 || !devpriv->lcfg) { if (!devpriv->las0 || !devpriv->las1 || !devpriv->lcfg)
return -ENOMEM; return -ENOMEM;
}
DPRINTK("%s: LAS0=%llx, LAS1=%llx, CFG=%llx.\n", dev->board_name, DPRINTK("%s: LAS0=%llx, LAS1=%llx, CFG=%llx.\n", dev->board_name,
(unsigned long long)physLas0, (unsigned long long)physLas1, (unsigned long long)physLas0, (unsigned long long)physLas1,
@ -849,7 +849,7 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
pci_read_config_byte(devpriv->pci_dev, pci_read_config_byte(devpriv->pci_dev,
PCI_LATENCY_TIMER, &pci_latency); PCI_LATENCY_TIMER, &pci_latency);
if (pci_latency < 32) { if (pci_latency < 32) {
printk("%s: PCI latency changed from %d to %d\n", printk(KERN_INFO "%s: PCI latency changed from %d to %d\n",
dev->board_name, pci_latency, 32); dev->board_name, pci_latency, 32);
pci_write_config_byte(devpriv->pci_dev, pci_write_config_byte(devpriv->pci_dev,
PCI_LATENCY_TIMER, 32); PCI_LATENCY_TIMER, 32);
@ -875,9 +875,9 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* Allocate the subdevice structures. alloc_subdevice() is a * Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h. * convenient macro defined in comedidev.h.
*/ */
if (alloc_subdevices(dev, 4) < 0) { if (alloc_subdevices(dev, 4) < 0)
return -ENOMEM; return -ENOMEM;
}
s = dev->subdevices + 0; s = dev->subdevices + 0;
dev->read_subdev = s; dev->read_subdev = s;
@ -887,11 +887,11 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
SDF_READABLE | SDF_GROUND | SDF_COMMON | SDF_DIFF | SDF_CMD_READ; SDF_READABLE | SDF_GROUND | SDF_COMMON | SDF_DIFF | SDF_CMD_READ;
s->n_chan = thisboard->aiChans; s->n_chan = thisboard->aiChans;
s->maxdata = (1 << thisboard->aiBits) - 1; s->maxdata = (1 << thisboard->aiBits) - 1;
if (thisboard->aiMaxGain <= 32) { if (thisboard->aiMaxGain <= 32)
s->range_table = &rtd_ai_7520_range; s->range_table = &rtd_ai_7520_range;
} else { else
s->range_table = &rtd_ai_4520_range; s->range_table = &rtd_ai_4520_range;
}
s->len_chanlist = RTD_MAX_CHANLIST; /* devpriv->fifoLen */ s->len_chanlist = RTD_MAX_CHANLIST; /* devpriv->fifoLen */
s->insn_read = rtd_ai_rinsn; s->insn_read = rtd_ai_rinsn;
s->do_cmd = rtd_ai_cmd; s->do_cmd = rtd_ai_cmd;
@ -961,9 +961,9 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
printk("( irq=%u )", dev->irq); printk("( irq=%u )", dev->irq);
ret = rtd520_probe_fifo_depth(dev); ret = rtd520_probe_fifo_depth(dev);
if (ret < 0) { if (ret < 0)
return ret; return ret;
}
devpriv->fifoLen = ret; devpriv->fifoLen = ret;
printk("( fifoLen=%d )", devpriv->fifoLen); printk("( fifoLen=%d )", devpriv->fifoLen);
@ -1028,7 +1028,7 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
RtdDma0Mode(dev, DMA_MODE_BITS); RtdDma0Mode(dev, DMA_MODE_BITS);
RtdDma0Source(dev, DMAS_ADFIFO_HALF_FULL); /* set DMA trigger source */ RtdDma0Source(dev, DMAS_ADFIFO_HALF_FULL); /* set DMA trigger source */
} else { } else {
printk("( no IRQ->no DMA )"); printk(KERN_INFO "( no IRQ->no DMA )");
} }
#endif /* USE_DMA */ #endif /* USE_DMA */
@ -1071,18 +1071,18 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
/* release all regions that were allocated */ /* release all regions that were allocated */
if (devpriv->las0) { if (devpriv->las0)
iounmap(devpriv->las0); iounmap(devpriv->las0);
}
if (devpriv->las1) { if (devpriv->las1)
iounmap(devpriv->las1); iounmap(devpriv->las1);
}
if (devpriv->lcfg) { if (devpriv->lcfg)
iounmap(devpriv->lcfg); iounmap(devpriv->lcfg);
}
if (devpriv->pci_dev) { if (devpriv->pci_dev)
pci_dev_put(devpriv->pci_dev); pci_dev_put(devpriv->pci_dev);
}
return ret; return ret;
#endif #endif
} }
@ -1158,24 +1158,24 @@ static int rtd_detach(struct comedi_device *dev)
} }
/* release all regions that were allocated */ /* release all regions that were allocated */
if (devpriv->las0) { if (devpriv->las0)
iounmap(devpriv->las0); iounmap(devpriv->las0);
}
if (devpriv->las1) { if (devpriv->las1)
iounmap(devpriv->las1); iounmap(devpriv->las1);
}
if (devpriv->lcfg) { if (devpriv->lcfg)
iounmap(devpriv->lcfg); iounmap(devpriv->lcfg);
}
if (devpriv->pci_dev) { if (devpriv->pci_dev) {
if (devpriv->got_regions) { if (devpriv->got_regions)
comedi_pci_disable(devpriv->pci_dev); comedi_pci_disable(devpriv->pci_dev);
}
pci_dev_put(devpriv->pci_dev); pci_dev_put(devpriv->pci_dev);
} }
} }
printk("comedi%d: rtd520: removed.\n", dev->minor); printk(KERN_INFO "comedi%d: rtd520: removed.\n", dev->minor);
return 0; return 0;
} }
@ -1275,13 +1275,13 @@ static int rtd520_probe_fifo_depth(struct comedi_device *dev)
} }
} }
if (i == limit) { if (i == limit) {
printk("\ncomedi: %s: failed to probe fifo size.\n", DRV_NAME); printk(KERN_INFO "\ncomedi: %s: failed to probe fifo size.\n", DRV_NAME);
return -EIO; return -EIO;
} }
RtdAdcClearFifo(dev); RtdAdcClearFifo(dev);
if (fifo_size != 0x400 && fifo_size != 0x2000) { if (fifo_size != 0x400 && fifo_size != 0x2000) {
printk printk
("\ncomedi: %s: unexpected fifo size of %i, expected 1024 or 8192.\n", (KERN_INFO "\ncomedi: %s: unexpected fifo size of %i, expected 1024 or 8192.\n",
DRV_NAME, fifo_size); DRV_NAME, fifo_size);
return -EIO; return -EIO;
} }
@ -1335,12 +1335,11 @@ static int rtd_ai_rinsn(struct comedi_device *dev,
d = RtdAdcFifoGet(dev); /* get 2s comp value */ d = RtdAdcFifoGet(dev); /* get 2s comp value */
/*printk ("rtd520: Got 0x%x after %d usec\n", d, ii+1); */ /*printk ("rtd520: Got 0x%x after %d usec\n", d, ii+1); */
d = d >> 3; /* low 3 bits are marker lines */ d = d >> 3; /* low 3 bits are marker lines */
if (CHAN_ARRAY_TEST(devpriv->chanBipolar, 0)) { if (CHAN_ARRAY_TEST(devpriv->chanBipolar, 0))
data[n] = d + 2048; /* convert to comedi unsigned data */ data[n] = d + 2048; /* convert to comedi unsigned data */
} else { else
data[n] = d; data[n] = d;
} }
}
/* return the number of samples read/written */ /* return the number of samples read/written */
return n; return n;
@ -1375,11 +1374,11 @@ static int ai_read_n(struct comedi_device *dev, struct comedi_subdevice *s,
d = RtdAdcFifoGet(dev); /* get 2s comp value */ d = RtdAdcFifoGet(dev); /* get 2s comp value */
d = d >> 3; /* low 3 bits are marker lines */ d = d >> 3; /* low 3 bits are marker lines */
if (CHAN_ARRAY_TEST(devpriv->chanBipolar, s->async->cur_chan)) { if (CHAN_ARRAY_TEST(devpriv->chanBipolar, s->async->cur_chan))
sample = d + 2048; /* convert to comedi unsigned data */ sample = d + 2048; /* convert to comedi unsigned data */
} else { else
sample = d; sample = d;
}
if (!comedi_buf_put(s->async, sample)) if (!comedi_buf_put(s->async, sample))
return -1; return -1;
@ -1403,11 +1402,11 @@ static int ai_read_dregs(struct comedi_device *dev, struct comedi_subdevice *s)
} }
d = d >> 3; /* low 3 bits are marker lines */ d = d >> 3; /* low 3 bits are marker lines */
if (CHAN_ARRAY_TEST(devpriv->chanBipolar, s->async->cur_chan)) { if (CHAN_ARRAY_TEST(devpriv->chanBipolar, s->async->cur_chan))
sample = d + 2048; /* convert to comedi unsigned data */ sample = d + 2048; /* convert to comedi unsigned data */
} else { else
sample = d; sample = d;
}
if (!comedi_buf_put(s->async, sample)) if (!comedi_buf_put(s->async, sample))
return -1; return -1;
@ -1493,9 +1492,9 @@ static int ai_process_dma(struct comedi_device *dev, struct comedi_subdevice *s)
if (CHAN_ARRAY_TEST(devpriv->chanBipolar, s->async->cur_chan)) { if (CHAN_ARRAY_TEST(devpriv->chanBipolar, s->async->cur_chan)) {
sample = (*dp >> 3) + 2048; /* convert to comedi unsigned data */ sample = (*dp >> 3) + 2048; /* convert to comedi unsigned data */
} else { else
sample = *dp >> 3; /* low 3 bits are marker lines */ sample = *dp >> 3; /* low 3 bits are marker lines */
}
*dp++ = sample; /* put processed value back */ *dp++ = sample; /* put processed value back */
if (++s->async->cur_chan >= s->async->cmd.chanlist_len) if (++s->async->cur_chan >= s->async->cmd.chanlist_len)
@ -1546,9 +1545,8 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */
u16 fifoStatus; u16 fifoStatus;
struct comedi_subdevice *s = dev->subdevices + 0; /* analog in subdevice */ struct comedi_subdevice *s = dev->subdevices + 0; /* analog in subdevice */
if (!dev->attached) { if (!dev->attached)
return IRQ_NONE; return IRQ_NONE;
}
devpriv->intCount++; /* DEBUG statistics */ devpriv->intCount++; /* DEBUG statistics */
@ -1594,9 +1592,8 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */
status = RtdInterruptStatus(dev); status = RtdInterruptStatus(dev);
/* if interrupt was not caused by our board, or handled above */ /* if interrupt was not caused by our board, or handled above */
if (0 == status) { if (0 == status)
return IRQ_HANDLED; return IRQ_HANDLED;
}
if (status & IRQM_ADC_ABOUT_CNT) { /* sample count -> read FIFO */ if (status & IRQM_ADC_ABOUT_CNT) { /* sample count -> read FIFO */
/* since the priority interrupt controller may have queued a sample /* since the priority interrupt controller may have queued a sample
@ -1734,33 +1731,32 @@ static int rtd_ai_cmdtest(struct comedi_device *dev,
tmp = cmd->start_src; tmp = cmd->start_src;
cmd->start_src &= TRIG_NOW; cmd->start_src &= TRIG_NOW;
if (!cmd->start_src || tmp != cmd->start_src) { if (!cmd->start_src || tmp != cmd->start_src)
err++; err++;
}
tmp = cmd->scan_begin_src; tmp = cmd->scan_begin_src;
cmd->scan_begin_src &= TRIG_TIMER | TRIG_EXT; cmd->scan_begin_src &= TRIG_TIMER | TRIG_EXT;
if (!cmd->scan_begin_src || tmp != cmd->scan_begin_src) { if (!cmd->scan_begin_src || tmp != cmd->scan_begin_src)
err++; err++;
}
tmp = cmd->convert_src; tmp = cmd->convert_src;
cmd->convert_src &= TRIG_TIMER | TRIG_EXT; cmd->convert_src &= TRIG_TIMER | TRIG_EXT;
if (!cmd->convert_src || tmp != cmd->convert_src) { if (!cmd->convert_src || tmp != cmd->convert_src)
err++; err++;
}
tmp = cmd->scan_end_src; tmp = cmd->scan_end_src;
cmd->scan_end_src &= TRIG_COUNT; cmd->scan_end_src &= TRIG_COUNT;
if (!cmd->scan_end_src || tmp != cmd->scan_end_src) { if (!cmd->scan_end_src || tmp != cmd->scan_end_src)
err++; err++;
}
tmp = cmd->stop_src; tmp = cmd->stop_src;
cmd->stop_src &= TRIG_COUNT | TRIG_NONE; cmd->stop_src &= TRIG_COUNT | TRIG_NONE;
if (!cmd->stop_src || tmp != cmd->stop_src) { if (!cmd->stop_src || tmp != cmd->stop_src)
err++; err++;
}
if (err) if (err)
return 1; return 1;
@ -1772,16 +1768,14 @@ static int rtd_ai_cmdtest(struct comedi_device *dev,
cmd->scan_begin_src != TRIG_EXT) { cmd->scan_begin_src != TRIG_EXT) {
err++; err++;
} }
if (cmd->convert_src != TRIG_TIMER && cmd->convert_src != TRIG_EXT) { if (cmd->convert_src != TRIG_TIMER && cmd->convert_src != TRIG_EXT)
err++; err++;
}
if (cmd->stop_src != TRIG_COUNT && cmd->stop_src != TRIG_NONE) {
err++;
}
if (err) { if (cmd->stop_src != TRIG_COUNT && cmd->stop_src != TRIG_NONE)
err++;
if (err)
return 2; return 2;
}
/* step 3: make sure arguments are trivially compatible */ /* step 3: make sure arguments are trivially compatible */
@ -1882,9 +1876,9 @@ static int rtd_ai_cmdtest(struct comedi_device *dev,
} }
} }
if (err) { if (err)
return 3; return 3;
}
/* step 4: fix up any arguments */ /* step 4: fix up any arguments */
@ -1896,17 +1890,17 @@ static int rtd_ai_cmdtest(struct comedi_device *dev,
tmp = cmd->scan_begin_arg; tmp = cmd->scan_begin_arg;
rtd_ns_to_timer(&cmd->scan_begin_arg, rtd_ns_to_timer(&cmd->scan_begin_arg,
cmd->flags & TRIG_ROUND_MASK); cmd->flags & TRIG_ROUND_MASK);
if (tmp != cmd->scan_begin_arg) { if (tmp != cmd->scan_begin_arg)
err++; err++;
}
} }
if (cmd->convert_src == TRIG_TIMER) { if (cmd->convert_src == TRIG_TIMER) {
tmp = cmd->convert_arg; tmp = cmd->convert_arg;
rtd_ns_to_timer(&cmd->convert_arg, rtd_ns_to_timer(&cmd->convert_arg,
cmd->flags & TRIG_ROUND_MASK); cmd->flags & TRIG_ROUND_MASK);
if (tmp != cmd->convert_arg) { if (tmp != cmd->convert_arg)
err++; err++;
}
if (cmd->scan_begin_src == TRIG_TIMER if (cmd->scan_begin_src == TRIG_TIMER
&& (cmd->scan_begin_arg && (cmd->scan_begin_arg
< (cmd->convert_arg * cmd->scan_end_arg))) { < (cmd->convert_arg * cmd->scan_end_arg))) {
@ -1916,9 +1910,8 @@ static int rtd_ai_cmdtest(struct comedi_device *dev,
} }
} }
if (err) { if (err)
return 4; return 4;
}
return 0; return 0;
} }
@ -2267,9 +2260,9 @@ static int rtd_ao_rinsn(struct comedi_device *dev,
int i; int i;
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
for (i = 0; i < insn->n; i++) { for (i = 0; i < insn->n; i++)
data[i] = devpriv->aoValue[chan]; data[i] = devpriv->aoValue[chan];
}
return i; return i;
} }