staging: comedi: range: remove subdevice pointer math
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 6 Sep 2012 01:59:44 +0000 (18:59 -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/range.c

index 5a6b6df0751392b98ae8c213b7a5bf9e76b20f9b..59ff0cf73381e8c97d35ab0b375242f1dc77fa2d 100644 (file)
@@ -68,7 +68,7 @@ int do_rangeinfo_ioctl(struct comedi_device *dev,
                return -EINVAL;
        if (subd >= dev->n_subdevices)
                return -EINVAL;
-       s = dev->subdevices + subd;
+       s = &dev->subdevices[subd];
        if (s->range_table) {
                lr = s->range_table;
        } else if (s->range_table_list) {