From: H Hartley Sweeten Date: Thu, 6 Sep 2012 01:24:52 +0000 (-0700) Subject: staging: comedi: adl_pci7x3x: remove subdevice pointer math X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2bac8ab3c348856d701ce7fbbd87622ed400bc65;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: adl_pci7x3x: remove subdevice pointer math Convert the comedi_subdevice access from pointer math to array access. Signed-off-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci7x3x.c b/drivers/staging/comedi/drivers/adl_pci7x3x.c index 48b3baa1b7a4..599714e978b5 100644 --- a/drivers/staging/comedi/drivers/adl_pci7x3x.c +++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c @@ -211,7 +211,7 @@ static int adl_pci7x3x_attach_pci(struct comedi_device *dev, if (board->di_nchan) { nchan = min(board->di_nchan, 32); - s = dev->subdevices + subdev; + s = &dev->subdevices[subdev]; /* Isolated digital inputs 0 to 15/31 */ s->type = COMEDI_SUBD_DI; s->subdev_flags = SDF_READABLE; @@ -226,7 +226,7 @@ static int adl_pci7x3x_attach_pci(struct comedi_device *dev, nchan = board->di_nchan - nchan; if (nchan) { - s = dev->subdevices + subdev; + s = &dev->subdevices[subdev]; /* Isolated digital inputs 32 to 63 */ s->type = COMEDI_SUBD_DI; s->subdev_flags = SDF_READABLE; @@ -244,7 +244,7 @@ static int adl_pci7x3x_attach_pci(struct comedi_device *dev, if (board->do_nchan) { nchan = min(board->do_nchan, 32); - s = dev->subdevices + subdev; + s = &dev->subdevices[subdev]; /* Isolated digital outputs 0 to 15/31 */ s->type = COMEDI_SUBD_DO; s->subdev_flags = SDF_WRITABLE; @@ -259,7 +259,7 @@ static int adl_pci7x3x_attach_pci(struct comedi_device *dev, nchan = board->do_nchan - nchan; if (nchan) { - s = dev->subdevices + subdev; + s = &dev->subdevices[subdev]; /* Isolated digital outputs 32 to 63 */ s->type = COMEDI_SUBD_DO; s->subdev_flags = SDF_WRITABLE;