staging: comedi: usbduxfast: remove subdevice pointer math
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 6 Sep 2012 01:58:32 +0000 (18:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Sep 2012 03:06:32 +0000 (20:06 -0700)
Convert the comedi_subdevice access from pointer math to array
access.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/usbduxfast.c

index 8eb41257c6ceca4dd9be11e997f95853dafdcdf2..3f68fc396301bebe65ddb97d2338d5f7d2877709 100644 (file)
@@ -346,7 +346,7 @@ static void usbduxfastsub_ai_Irq(struct urb *urb)
                return;
        }
        /* subdevice which is the AD converter */
-       s = this_comedidev->subdevices + SUBDEV_AD;
+       s = &this_comedidev->subdevices[SUBDEV_AD];
 
        /* first we test if something unusual has just happened */
        switch (urb->status) {
@@ -1453,7 +1453,7 @@ static int usbduxfast_attach_common(struct comedi_device *dev,
        /* private structure is also simply the usb-structure */
        dev->private = udfs;
        /* the first subdevice is the A/D converter */
-       s = dev->subdevices + SUBDEV_AD;
+       s = &dev->subdevices[SUBDEV_AD];
        /*
         * the URBs get the comedi subdevice which is responsible for reading
         * this is the subdevice which reads data