diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-05-27 17:31:13 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-28 21:28:56 (GMT) |
commit | 71cf2b4aaa1c1055ade82917972832f70180cfcb (patch) | |
tree | beaaacbf1909e62d360dfd64d6923d2be61aaec3 /drivers/staging/comedi | |
parent | 42e21c974377e2188888d88b2cf2d3c95033d9d7 (diff) | |
download | linux-71cf2b4aaa1c1055ade82917972832f70180cfcb.tar.xz |
staging: comedi: usbduxfast: remove unreachable code in usbduxfast_ai_cmd()
The (*do_cmdtest) validates that the 'stop_arg' is >= 1 for a 'stop_src'
of TRIG_COUNT and the 'scan_end_arg' is validated to be the 'chanlist_len'
which will always be >= 1. Remove the unreachable error code for an
'ai_sample_count < 1'.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/usbduxfast.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c index 376d146..85f9dcf 100644 --- a/drivers/staging/comedi/drivers/usbduxfast.c +++ b/drivers/staging/comedi/drivers/usbduxfast.c @@ -809,18 +809,11 @@ static int usbduxfast_ai_cmd(struct comedi_device *dev, up(&devpriv->sem); return result; } - if (cmd->stop_src == TRIG_COUNT) { + + if (cmd->stop_src == TRIG_COUNT) devpriv->ai_sample_count = cmd->stop_arg * cmd->scan_end_arg; - if (devpriv->ai_sample_count < 1) { - dev_err(dev->class_dev, - "(cmd->stop_arg)*(cmd->scan_end_arg)<1, aborting\n"); - up(&devpriv->sem); - return -EFAULT; - } - } else { - /* continous acquisition */ + else /* TRIG_NONE */ devpriv->ai_sample_count = 0; - } if ((cmd->start_src == TRIG_NOW) || (cmd->start_src == TRIG_EXT)) { /* enable this acquisition operation */ |