Commit fa93e19d authored by Andrea Gelmini's avatar Andrea Gelmini Committed by Greg Kroah-Hartman

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: default avatarAndrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 20962c10
...@@ -18,10 +18,10 @@ Configuration options: ...@@ -18,10 +18,10 @@ Configuration options:
[1] - unused [1] - unused
[2] - A/D reference 0=differential, 1=single-ended [2] - A/D reference 0=differential, 1=single-ended
[3] - A/D range [3] - A/D range
0 = [-10,10] 0 = [-10, 10]
1 = [0,10] 1 = [0,10]
[4] - D/A 0 range [4] - D/A 0 range
0 = [-10,10] 0 = [-10, 10]
1 = [-5,5] 1 = [-5,5]
2 = [-2.5,2.5] 2 = [-2.5,2.5]
3 = [0,10] 3 = [0,10]
...@@ -279,9 +279,8 @@ static int dt2801_readdata(struct comedi_device *dev, int *data) ...@@ -279,9 +279,8 @@ static int dt2801_readdata(struct comedi_device *dev, int *data)
do { do {
stat = inb_p(dev->iobase + DT2801_STATUS); 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; return stat;
}
if (stat & DT_S_DATA_OUT_READY) { if (stat & DT_S_DATA_OUT_READY) {
*data = inb_p(dev->iobase + DT2801_DATA); *data = inb_p(dev->iobase + DT2801_DATA);
return 0; return 0;
...@@ -315,9 +314,8 @@ static int dt2801_writedata(struct comedi_device *dev, unsigned int data) ...@@ -315,9 +314,8 @@ static int dt2801_writedata(struct comedi_device *dev, unsigned int data)
do { do {
stat = inb_p(dev->iobase + DT2801_STATUS); stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_COMPOSITE_ERROR) { if (stat & DT_S_COMPOSITE_ERROR)
return stat; return stat;
}
if (!(stat & DT_S_DATA_IN_FULL)) { if (!(stat & DT_S_DATA_IN_FULL)) {
outb_p(data & 0xff, dev->iobase + DT2801_DATA); outb_p(data & 0xff, dev->iobase + DT2801_DATA);
return 0; return 0;
...@@ -354,18 +352,15 @@ static int dt2801_wait_for_ready(struct comedi_device *dev) ...@@ -354,18 +352,15 @@ static int dt2801_wait_for_ready(struct comedi_device *dev)
int stat; int stat;
stat = inb_p(dev->iobase + DT2801_STATUS); stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_READY) { if (stat & DT_S_READY)
return 0; return 0;
}
do { do {
stat = inb_p(dev->iobase + DT2801_STATUS); stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_COMPOSITE_ERROR) { if (stat & DT_S_COMPOSITE_ERROR)
return stat; return stat;
} if (stat & DT_S_READY)
if (stat & DT_S_READY) {
return 0; return 0;
}
} while (--timeout > 0); } while (--timeout > 0);
return -ETIME; return -ETIME;
...@@ -382,9 +377,8 @@ static int dt2801_writecmd(struct comedi_device *dev, int command) ...@@ -382,9 +377,8 @@ static int dt2801_writecmd(struct comedi_device *dev, int command)
printk printk
("dt2801: composite-error in dt2801_writecmd(), ignoring\n"); ("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"); printk("dt2801: !ready in dt2801_writecmd(), ignoring\n");
}
outb_p(command, dev->iobase + DT2801_CMD); outb_p(command, dev->iobase + DT2801_CMD);
return 0; return 0;
...@@ -418,9 +412,8 @@ static int dt2801_reset(struct comedi_device *dev) ...@@ -418,9 +412,8 @@ static int dt2801_reset(struct comedi_device *dev)
if (stat & DT_S_READY) if (stat & DT_S_READY)
break; break;
} while (timeout--); } while (timeout--);
if (!timeout) { if (!timeout)
printk("dt2801: timeout 1 status=0x%02x\n", stat); printk("dt2801: timeout 1 status=0x%02x\n", stat);
}
/* printk("dt2801: reading dummy\n"); */ /* printk("dt2801: reading dummy\n"); */
/* dt2801_readdata(dev,&board_code); */ /* dt2801_readdata(dev,&board_code); */
...@@ -436,9 +429,8 @@ static int dt2801_reset(struct comedi_device *dev) ...@@ -436,9 +429,8 @@ static int dt2801_reset(struct comedi_device *dev)
if (stat & DT_S_READY) if (stat & DT_S_READY)
break; break;
} while (timeout--); } while (timeout--);
if (!timeout) { if (!timeout)
printk("dt2801: timeout 2 status=0x%02x\n", stat); printk("dt2801: timeout 2 status=0x%02x\n", stat);
}
DPRINTK("dt2801: reading code\n"); DPRINTK("dt2801: reading code\n");
dt2801_readdata(dev, &board_code); dt2801_readdata(dev, &board_code);
...@@ -623,11 +615,10 @@ static int dt2801_detach(struct comedi_device *dev) ...@@ -623,11 +615,10 @@ static int dt2801_detach(struct comedi_device *dev)
static int dt2801_error(struct comedi_device *dev, int stat) static int dt2801_error(struct comedi_device *dev, int stat)
{ {
if (stat < 0) { if (stat < 0) {
if (stat == -ETIME) { if (stat == -ETIME)
printk("dt2801: timeout\n"); printk("dt2801: timeout\n");
} else { else
printk("dt2801: error %d\n", stat); printk("dt2801: error %d\n", stat);
}
return stat; return stat;
} }
printk("dt2801: error status 0x%02x, resetting...\n", stat); printk("dt2801: error status 0x%02x, resetting...\n", stat);
......
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