From: H Hartley Sweeten Date: Thu, 6 Sep 2012 01:34:16 +0000 (-0700) Subject: staging: comedi: comedi_test: remove subdevice pointer math X-Git-Tag: firefly_0821_release~3680^2~1977^2~637 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=713e5c35e10215874ae60ef57912f21b31bc3ccc;p=firefly-linux-kernel-4.4.55.git staging: comedi: comedi_test: 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/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index 8ea9202ecba7..b0f0ec58dfed 100644 --- a/drivers/staging/comedi/drivers/comedi_test.c +++ b/drivers/staging/comedi/drivers/comedi_test.c @@ -453,7 +453,7 @@ static int waveform_attach(struct comedi_device *dev, if (ret) return ret; - s = dev->subdevices + 0; + s = &dev->subdevices[0]; dev->read_subdev = s; /* analog input subdevice */ s->type = COMEDI_SUBD_AI; @@ -467,7 +467,7 @@ static int waveform_attach(struct comedi_device *dev, s->do_cmdtest = waveform_ai_cmdtest; s->cancel = waveform_ai_cancel; - s = dev->subdevices + 1; + s = &dev->subdevices[1]; dev->write_subdev = s; /* analog output subdevice (loopback) */ s->type = COMEDI_SUBD_AO;