Skip to content

Commit

Permalink
staging: comedi: ni_labpc: simplify labpc_range_is_unipolar()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Mar 26, 2013
1 parent e7a1aa6 commit 43d092c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/staging/comedi/drivers/ni_labpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 43d092c

Please sign in to comment.