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

index ac406cf542825be732ba62477cfa7091a1188ada..05e06e7ba9f74f44d42d150f8fb4c318b1cbeadb 100644 (file)
@@ -231,7 +231,7 @@ static int adl_pci8164_attach_pci(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       s = dev->subdevices + 0;
+       s = &dev->subdevices[0];
        s->type = COMEDI_SUBD_PROC;
        s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
        s->n_chan = 4;
@@ -241,7 +241,7 @@ static int adl_pci8164_attach_pci(struct comedi_device *dev,
        s->insn_read = adl_pci8164_insn_read_msts;
        s->insn_write = adl_pci8164_insn_write_cmd;
 
-       s = dev->subdevices + 1;
+       s = &dev->subdevices[1];
        s->type = COMEDI_SUBD_PROC;
        s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
        s->n_chan = 4;
@@ -251,7 +251,7 @@ static int adl_pci8164_attach_pci(struct comedi_device *dev,
        s->insn_read = adl_pci8164_insn_read_ssts;
        s->insn_write = adl_pci8164_insn_write_otp;
 
-       s = dev->subdevices + 2;
+       s = &dev->subdevices[2];
        s->type = COMEDI_SUBD_PROC;
        s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
        s->n_chan = 4;
@@ -261,7 +261,7 @@ static int adl_pci8164_attach_pci(struct comedi_device *dev,
        s->insn_read = adl_pci8164_insn_read_buf0;
        s->insn_write = adl_pci8164_insn_write_buf0;
 
-       s = dev->subdevices + 3;
+       s = &dev->subdevices[3];
        s->type = COMEDI_SUBD_PROC;
        s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
        s->n_chan = 4;