staging: comedi: hwdrv_APCI1710: remove subdevice pointer math
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 6 Sep 2012 01:23:09 +0000 (18:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Sep 2012 03:01:35 +0000 (20:01 -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/addi-data/hwdrv_APCI1710.c

index 595238feaf42b9f88871ee495ec7af7e21d12312..f9a8937be8ed160a2051b3f1d8cfd6940b824c4e 100644 (file)
@@ -67,7 +67,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
                return;
 
        /*  Allocate and Initialise Timer Subdevice Structures */
-       s = dev->subdevices + 0;
+       s = &dev->subdevices[0];
 
        s->type = COMEDI_SUBD_TIMER;
        s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
@@ -81,7 +81,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        s->insn_bits = i_APCI1710_InsnBitsTimer;
 
        /*  Allocate and Initialise DIO Subdevice Structures */
-       s = dev->subdevices + 1;
+       s = &dev->subdevices[1];
 
        s->type = COMEDI_SUBD_DIO;
        s->subdev_flags =
@@ -96,7 +96,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        s->insn_write = i_APCI1710_InsnWriteDigitalIOChlOnOff;
 
        /*  Allocate and Initialise Chrono Subdevice Structures */
-       s = dev->subdevices + 2;
+       s = &dev->subdevices[2];
 
        s->type = COMEDI_SUBD_CHRONO;
        s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
@@ -110,7 +110,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        s->insn_bits = i_APCI1710_InsnBitsChronoDigitalIO;
 
        /*  Allocate and Initialise PWM Subdevice Structures */
-       s = dev->subdevices + 3;
+       s = &dev->subdevices[3];
        s->type = COMEDI_SUBD_PWM;
        s->subdev_flags =
                SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
@@ -125,7 +125,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        s->insn_bits = i_APCI1710_InsnBitsReadPWMInterrupt;
 
        /*  Allocate and Initialise TTLIO Subdevice Structures */
-       s = dev->subdevices + 4;
+       s = &dev->subdevices[4];
        s->type = COMEDI_SUBD_TTLIO;
        s->subdev_flags =
                SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
@@ -139,7 +139,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        s->insn_read = i_APCI1710_InsnReadTTLIOAllPortValue;
 
        /*  Allocate and Initialise TOR Subdevice Structures */
-       s = dev->subdevices + 5;
+       s = &dev->subdevices[5];
        s->type = COMEDI_SUBD_TOR;
        s->subdev_flags =
                SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
@@ -154,7 +154,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        s->insn_bits = i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue;
 
        /*  Allocate and Initialise SSI Subdevice Structures */
-       s = dev->subdevices + 6;
+       s = &dev->subdevices[6];
        s->type = COMEDI_SUBD_SSI;
        s->subdev_flags =
                SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
@@ -167,7 +167,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        s->insn_bits = i_APCI1710_InsnBitsSSIDigitalIO;
 
        /*  Allocate and Initialise PULSEENCODER Subdevice Structures */
-       s = dev->subdevices + 7;
+       s = &dev->subdevices[7];
        s->type = COMEDI_SUBD_PULSEENCODER;
        s->subdev_flags =
                SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
@@ -181,7 +181,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        s->insn_read = i_APCI1710_InsnReadInterruptPulseEncoder;
 
        /*  Allocate and Initialise INCREMENTALCOUNTER Subdevice Structures */
-       s = dev->subdevices + 8;
+       s = &dev->subdevices[8];
        s->type = COMEDI_SUBD_INCREMENTALCOUNTER;
        s->subdev_flags =
                SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;