diff options
author | Andrea Gelmini <andrea.gelmini@gelma.net> | 2010-02-26 10:15:10 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 16:43:06 -0800 |
commit | fa93e19dcf8600c87a60160735b1065cd4bb4dbb (patch) | |
tree | 08f97002e58b85dfaa5f5286f86fbbab0803be18 | |
parent | 20962c10c19862c58c03eec2434279a5d104c40e (diff) |
Staging: comedi: dt2801.c: Checkpatch cleanup
ERROR: code indent should use tabs where possible
+ 0 = [-10,10]$
ERROR: code indent should use tabs where possible
+ 0 = [-10,10]$
WARNING: braces {} are not necessary for single statement blocks
+ if (stat & (DT_S_COMPOSITE_ERROR | DT_S_READY)) {
+ return stat;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (stat & DT_S_COMPOSITE_ERROR) {
+ return stat;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (stat & DT_S_READY) {
+ return 0;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (stat & DT_S_COMPOSITE_ERROR) {
+ return stat;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (stat & DT_S_READY) {
+ return 0;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (!(stat & DT_S_READY)) {
+ printk("dt2801: !ready in dt2801_writecmd(), ignoring\n");
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (!timeout) {
+ printk("dt2801: timeout 1 status=0x%02x\n", stat);
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (!timeout) {
+ printk("dt2801: timeout 2 status=0x%02x\n", stat);
+ }
WARNING: braces {} are not necessary for any arm of this statement
+ if (stat == -ETIME) {
[...]
+ } else {
[...]
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/comedi/drivers/dt2801.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c index 7b9af5d755e0..3f365aee4822 100644 --- a/drivers/staging/comedi/drivers/dt2801.c +++ b/drivers/staging/comedi/drivers/dt2801.c @@ -18,10 +18,10 @@ Configuration options: [1] - unused [2] - A/D reference 0=differential, 1=single-ended [3] - A/D range - 0 = [-10,10] + 0 = [-10, 10] 1 = [0,10] [4] - D/A 0 range - 0 = [-10,10] + 0 = [-10, 10] 1 = [-5,5] 2 = [-2.5,2.5] 3 = [0,10] @@ -279,9 +279,8 @@ static int dt2801_readdata(struct comedi_device *dev, int *data) do { stat = inb_p(dev->iobase + DT2801_STATUS); - if (stat & (DT_S_COMPOSITE_ERROR | DT_S_READY)) { + if (stat & (DT_S_COMPOSITE_ERROR | DT_S_READY)) return stat; - } if (stat & DT_S_DATA_OUT_READY) { *data = inb_p(dev->iobase + DT2801_DATA); return 0; @@ -315,9 +314,8 @@ static int dt2801_writedata(struct comedi_device *dev, unsigned int data) do { stat = inb_p(dev->iobase + DT2801_STATUS); - if (stat & DT_S_COMPOSITE_ERROR) { + if (stat & DT_S_COMPOSITE_ERROR) return stat; - } if (!(stat & DT_S_DATA_IN_FULL)) { outb_p(data & 0xff, dev->iobase + DT2801_DATA); return 0; @@ -354,18 +352,15 @@ static int dt2801_wait_for_ready(struct comedi_device *dev) int stat; stat = inb_p(dev->iobase + DT2801_STATUS); - if (stat & DT_S_READY) { + if (stat & DT_S_READY) return 0; - } do { stat = inb_p(dev->iobase + DT2801_STATUS); - if (stat & DT_S_COMPOSITE_ERROR) { + if (stat & DT_S_COMPOSITE_ERROR) return stat; - } - if (stat & DT_S_READY) { + if (stat & DT_S_READY) return 0; - } } while (--timeout > 0); return -ETIME; @@ -382,9 +377,8 @@ static int dt2801_writecmd(struct comedi_device *dev, int command) printk ("dt2801: composite-error in dt2801_writecmd(), ignoring\n"); } - if (!(stat & DT_S_READY)) { + if (!(stat & DT_S_READY)) printk("dt2801: !ready in dt2801_writecmd(), ignoring\n"); - } outb_p(command, dev->iobase + DT2801_CMD); return 0; @@ -418,9 +412,8 @@ static int dt2801_reset(struct comedi_device *dev) if (stat & DT_S_READY) break; } while (timeout--); - if (!timeout) { + if (!timeout) printk("dt2801: timeout 1 status=0x%02x\n", stat); - } /* printk("dt2801: reading dummy\n"); */ /* dt2801_readdata(dev,&board_code); */ @@ -436,9 +429,8 @@ static int dt2801_reset(struct comedi_device *dev) if (stat & DT_S_READY) break; } while (timeout--); - if (!timeout) { + if (!timeout) printk("dt2801: timeout 2 status=0x%02x\n", stat); - } DPRINTK("dt2801: reading code\n"); dt2801_readdata(dev, &board_code); @@ -623,11 +615,10 @@ static int dt2801_detach(struct comedi_device *dev) static int dt2801_error(struct comedi_device *dev, int stat) { if (stat < 0) { - if (stat == -ETIME) { + if (stat == -ETIME) printk("dt2801: timeout\n"); - } else { + else printk("dt2801: error %d\n", stat); - } return stat; } printk("dt2801: error status 0x%02x, resetting...\n", stat); |