[PATCH 2/4] staging: comedi: ni_labpc: simplify labpc_range_is_unipolar()

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

 



As Ian Abbott pointed out, this helper function can be simplified
by just checking if the 'min' value is >= 0.

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

diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c
index a9117f7..b0ec088 100644
--- a/drivers/staging/comedi/drivers/ni_labpc.c
+++ b/drivers/staging/comedi/drivers/ni_labpc.c
@@ -320,13 +320,7 @@ static int labpc_counter_set_mode(struct comedi_device *dev,
 static bool labpc_range_is_unipolar(struct comedi_subdevice *s,
 				    unsigned int range)
 {
-	const struct comedi_lrange *lrange = s->range_table;
-	const struct comedi_krange *krange = &lrange->range[range];
-
-	if (krange->min < 0)
-		return false;
-	else
-		return true;
+	return s->range_table->range[range].min >= 0;
 }
 
 static int labpc_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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