staging: comedi: usbdux: use 'cmd' pointer in usbduxsub_ai_isoc_irq()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 27 May 2014 17:30:43 +0000 (10:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 21:28:52 +0000 (14:28 -0700)
Use the 'cmd' pointer to access the chanlist instead of getting to it
using the comedi_subdevice pointer.

Remove the unneeded 'n' local variable, this is just the cmd->chanlist_len.

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/usbdux.c

index e61e4a93cc19bb3ce015ed9c19332ec99a970deb..5f65e4213c6e5841f55ad9f1d58cde7ecfbcdd4b 100644 (file)
@@ -264,7 +264,7 @@ static void usbduxsub_ai_isoc_irq(struct urb *urb)
        struct comedi_subdevice *s = dev->read_subdev;
        struct usbdux_private *devpriv = dev->private;
        struct comedi_cmd *cmd = &s->async->cmd;
-       int i, err, n;
+       int i, err;
 
        /* first we test if something unusual has just happened */
        switch (urb->status) {
@@ -361,9 +361,8 @@ static void usbduxsub_ai_isoc_irq(struct urb *urb)
                }
        }
        /* get the data from the USB bus and hand it over to comedi */
-       n = s->async->cmd.chanlist_len;
-       for (i = 0; i < n; i++) {
-               unsigned int range = CR_RANGE(s->async->cmd.chanlist[i]);
+       for (i = 0; i < cmd->chanlist_len; i++) {
+               unsigned int range = CR_RANGE(cmd->chanlist[i]);
                uint16_t val = le16_to_cpu(devpriv->in_buf[i]);
 
                /* bipolar data is two's-complement */