Re: [PATCH 1/3] staging: comedi: dt282x: remove unnecessary comedi_check_trigger_arg_max()

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

 



On 22/03/16 17:01, H Hartley Sweeten wrote:
Step 4 of the (*do_cmdtest) calls dt282x_ns_to_timer() to work out the
divisor needed to generate the 'convert_arg' timing. If the 'convert_arg'
timing can not be generated, the function returns the max timing that can
be generated.

The Step 3 'max' check of the 'convert_arg' isn't necessary.

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

diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c
index 06a87a1..be6a0bc 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -689,8 +689,6 @@ static int dt282x_ai_cmdtest(struct comedi_device *dev,

  	err |= comedi_check_trigger_arg_min(&cmd->convert_arg, 4000);

-#define SLOWEST_TIMER	(250*(1<<15)*255)
-	err |= comedi_check_trigger_arg_max(&cmd->convert_arg, SLOWEST_TIMER);
  	err |= comedi_check_trigger_arg_min(&cmd->convert_arg, board->ai_speed);
  	err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg,
  					   cmd->chanlist_len);


I'd be inclined to keep the existing check in place, as it goes with the arg_min test (although one of the arg_min tests on convert_arg is redundant, as you point out in patch 2).

--
-=( 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