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

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
Loading
Loading
Loading
Loading
+12 −21
Original line number Diff line number Diff line
@@ -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);