Commit c6c04f05 authored by Tapasweni Pathak's avatar Tapasweni Pathak Committed by Greg Kroah-Hartman

staging: comedi: Remove unecessary function and it's call

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: default avatarTapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fe43ec53
...@@ -97,39 +97,6 @@ int do_rangeinfo_ioctl(struct comedi_device *dev, ...@@ -97,39 +97,6 @@ int do_rangeinfo_ioctl(struct comedi_device *dev,
return 0; 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. * comedi_check_chanlist() - Validate each element in a chanlist.
* @s: comedi_subdevice struct * @s: comedi_subdevice struct
...@@ -153,8 +120,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s, int n, ...@@ -153,8 +120,7 @@ int comedi_check_chanlist(struct comedi_subdevice *s, int n,
else else
range_len = 0; range_len = 0;
if (chan >= s->n_chan || if (chan >= s->n_chan ||
CR_RANGE(chanspec) >= range_len || CR_RANGE(chanspec) >= range_len) {
aref_invalid(s, chanspec)) {
dev_warn(dev->class_dev, dev_warn(dev->class_dev,
"bad chanlist[%d]=0x%08x chan=%d range length=%d\n", "bad chanlist[%d]=0x%08x chan=%d range length=%d\n",
i, chanspec, chan, range_len); i, chanspec, chan, range_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment