[PATCH 22/25] staging: comedi: das16m1: minor cleanup to das16m1_ai_insn_read()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The (*insn_read) functions return the number of data values read. The 'n'
value is correct but for clarity change the return to 'insn->n'.

For aesthetics, change the 'n' loop variable name to 'i'. That's more common
in comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/das16m1.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das16m1.c b/drivers/staging/comedi/drivers/das16m1.c
index d4b1b92..c0f2796 100644
--- a/drivers/staging/comedi/drivers/das16m1.c
+++ b/drivers/staging/comedi/drivers/das16m1.c
@@ -324,11 +324,11 @@ static int das16m1_ai_insn_read(struct comedi_device *dev,
 				unsigned int *data)
 {
 	int ret;
-	int n;
+	int i;
 
 	das16m1_ai_set_queue(dev, &insn->chanspec, 1);
 
-	for (n = 0; n < insn->n; n++) {
+	for (i = 0; i < insn->n; i++) {
 		unsigned short val;
 
 		/* clear interrupt */
@@ -341,10 +341,10 @@ static int das16m1_ai_insn_read(struct comedi_device *dev,
 			return ret;
 
 		val = inw(dev->iobase + DAS16M1_AI_REG);
-		data[n] = DAS16M1_AI_TO_SAMPLE(val);
+		data[i] = DAS16M1_AI_TO_SAMPLE(val);
 	}
 
-	return n;
+	return insn->n;
 }
 
 static int das16m1_di_insn_bits(struct comedi_device *dev,
-- 
2.6.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux