]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: comedi: pcl711: tidy up pcl711_ao_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 20 Sep 2013 23:38:29 +0000 (16:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Sep 2013 22:59:58 +0000 (15:59 -0700)
Tidy up this function to follow the normal form 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/pcl711.c

index 9e19fe91a47cf9cb444dde5c2a4a5e4d2283e86a..3a2e5f16d28408136a0be2cb54cbc80e056ec907 100644 (file)
@@ -431,17 +431,17 @@ static int pcl711_ao_insn_write(struct comedi_device *dev,
 
 static int pcl711_ao_insn_read(struct comedi_device *dev,
                               struct comedi_subdevice *s,
-                              struct comedi_insn *insn, unsigned int *data)
+                              struct comedi_insn *insn,
+                              unsigned int *data)
 {
        struct pcl711_private *devpriv = dev->private;
-       int n;
-       int chan = CR_CHAN(insn->chanspec);
-
-       for (n = 0; n < insn->n; n++)
-               data[n] = devpriv->ao_readback[chan];
+       unsigned int chan = CR_CHAN(insn->chanspec);
+       int i;
 
-       return n;
+       for (i = 0; i < insn->n; i++)
+               data[i] = devpriv->ao_readback[chan];
 
+       return insn->n;
 }
 
 /* Digital port read - Untested on 8112 */