staging: comedi: Remove unecessary function and it's call
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Tue, 7 Oct 2014 17:50:24 +0000 (23:20 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:13 +0000 (10:29 +0800)
Function aref_invalid has unreachable code as it right now
just returns 0 after declaring a variable.
This patch removes this function and it's single call.

As it is static so it's obvious that it is not used anywhere
other than this file or somewhere, where this is included.
I also build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/range.c

index b684954..9a1dc56 100644 (file)
@@ -97,39 +97,6 @@ int do_rangeinfo_ioctl(struct comedi_device *dev,
        return 0;
 }
 
-static int aref_invalid(struct comedi_subdevice *s, unsigned int chanspec)
-{
-       unsigned int aref;
-
-       /*  disable reporting invalid arefs... maybe someday */
-       return 0;
-
-       aref = CR_AREF(chanspec);
-       switch (aref) {
-       case AREF_DIFF:
-               if (s->subdev_flags & SDF_DIFF)
-                       return 0;
-               break;
-       case AREF_COMMON:
-               if (s->subdev_flags & SDF_COMMON)
-                       return 0;
-               break;
-       case AREF_GROUND:
-               if (s->subdev_flags & SDF_GROUND)
-                       return 0;
-               break;
-       case AREF_OTHER:
-               if (s->subdev_flags & SDF_OTHER)
-                       return 0;
-               break;
-       default:
-               break;
-       }
-       dev_dbg(s->device->class_dev, "subdevice does not support aref %i",
-               aref);
-       return 1;
-}
-
 /**
  * comedi_check_chanlist() - Validate each element in a chanlist.
  * @s: comedi_subdevice struct
@@ -153,8 +120,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s, int n,
                else
                        range_len = 0;
                if (chan >= s->n_chan ||
-                   CR_RANGE(chanspec) >= range_len ||
-                   aref_invalid(s, chanspec)) {
+                   CR_RANGE(chanspec) >= range_len) {
                        dev_warn(dev->class_dev,
                                 "bad chanlist[%d]=0x%08x chan=%d range length=%d\n",
                                 i, chanspec, chan, range_len);