[RFC PATCH 32/36] staging: comedi: amplc_dio200_common: remove unnecessary 'counter_number' checks

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

 



The 'counter_number' in these functions is the comedi channel number from the
chanspec. The comedi core validates the chanspec before calling the driver
functions. Remove the unnecessary checks.

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

diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index 6ef70a5..48cdddc 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -577,8 +577,6 @@ static int dio200_subdev_8254_set_gate_src(struct comedi_device *dev,
 
 	if (!board->has_clk_gat_sce)
 		return -1;
-	if (counter_number > 2)
-		return -1;
 	if (gate_src > (board->is_pcie ? 31 : 7))
 		return -1;
 
@@ -598,8 +596,6 @@ static int dio200_subdev_8254_get_gate_src(struct comedi_device *dev,
 
 	if (!board->has_clk_gat_sce)
 		return -1;
-	if (counter_number > 2)
-		return -1;
 
 	return subpriv->gate_src[counter_number];
 }
@@ -615,8 +611,6 @@ static int dio200_subdev_8254_set_clock_src(struct comedi_device *dev,
 
 	if (!board->has_clk_gat_sce)
 		return -1;
-	if (counter_number > 2)
-		return -1;
 	if (clock_src > (board->is_pcie ? 31 : 7))
 		return -1;
 
@@ -638,8 +632,6 @@ static int dio200_subdev_8254_get_clock_src(struct comedi_device *dev,
 
 	if (!board->has_clk_gat_sce)
 		return -1;
-	if (counter_number > 2)
-		return -1;
 
 	clock_src = subpriv->clock_src[counter_number];
 	*period_ns = clock_period[clock_src];
-- 
2.3.0

_______________________________________________
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