Re: [PATCH 8/9] staging: comedi: usbduxfast: remove (*do_cmd) MIN_SAMPLING_PERIOD check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14/08/15 22:29, H Hartley Sweeten wrote:
The (*do_cmdtest) properly checks the MIN_SAMPLE_PERIOD. Remove the
redundant check in the (*do_cmd).

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
  drivers/staging/comedi/drivers/usbduxfast.c | 8 --------
  1 file changed, 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c
index 649d56e..3468c03 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -512,14 +512,6 @@ static int usbduxfast_ai_cmd(struct comedi_device *dev,
  	if (cmd->convert_src == TRIG_TIMER)
  		steps = (cmd->convert_arg * 30) / 1000;

-	if ((steps < MIN_SAMPLING_PERIOD) && (cmd->chanlist_len != 1)) {
-		dev_err(dev->class_dev,
-			"steps=%ld, scan_begin_arg=%d. Not properly tested by cmdtest?\n",
-			steps, cmd->scan_begin_arg);
-		up(&devpriv->sem);
-		return -EINVAL;
-	}
-

I'm wondering what happens when cmd->convert_src == TRIG_EXT? In that case, 'steps' would have its initial value of 0 in the above code, which would imply that chanlist_len would need to be 1.

The remainder of usbduxfast_ai_cmd() doesn't seem to have any support for cmd->convert_src == TRIG_EXT nor for cmd->scan_begin_src == TRIG_EXT, i.e. it doesn't set things up any differently. It seems to assume cmd->scan_begin_src == TRIG_FOLLOW and cmd->convert_src == TRIG_TIMER. So I guess the usbduxfast_ai_cmdtest() should be modified to only allow that.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux