staging: comedi: das16m1: minor cleanup to das16m1_ai_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 3 May 2016 19:30:00 +0000 (12:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Jun 2016 03:42:21 +0000 (20:42 -0700)
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@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/das16m1.c

index d4b1b92cb11267046270cb12c9a31fbb523b6986..c0f279638cd87762f46622de3eb89c2bb6b56806 100644 (file)
@@ -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,