Skip to content

Commit

Permalink
staging: comedi: ni_660x: remove BUG_ON(chan >= NUM_PFI_CHANNELS)
Browse files Browse the repository at this point in the history
This BUG_ON can never happen. The 'chan' value comes from the comedi
core in the insn->chanspec and will always be in range for the subdevice
number of channels (s->n_chan = NUM_PFI_CHANNELS).

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 Oct 24, 2012
1 parent 9186ccd commit e0f6959
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/staging/comedi/drivers/ni_660x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,6 @@ static int ni_660x_set_pfi_routing(struct comedi_device *dev, unsigned chan,
if (source == pfi_output_select_do)
return -EINVAL;
}
BUG_ON(chan >= NUM_PFI_CHANNELS);

devpriv->pfi_output_selects[chan] = source;
if (devpriv->pfi_direction_bits & (((uint64_t) 1) << chan))
Expand All @@ -1120,7 +1119,6 @@ static unsigned ni_660x_get_pfi_routing(struct comedi_device *dev,
{
struct ni_660x_private *devpriv = dev->private;

BUG_ON(chan >= NUM_PFI_CHANNELS);
return devpriv->pfi_output_selects[chan];
}

Expand Down

0 comments on commit e0f6959

Please sign in to comment.