staging: comedi: ni_labpc: simplify labpc_range_is_unipolar()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 26 Mar 2013 17:26:38 +0000 (10:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Mar 2013 23:14:51 +0000 (16:14 -0700)
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@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_labpc.c

index a9117f77b9b234551e6d7c7687243dc4fee935f9..b0ec088a7285e76fb9d0999c2d06ed47364c0e7d 100644 (file)
@@ -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)