staging: comedi: ni_mio_common: remove BUG_ON(gpct_index ...) checks

The gpct_index will always be 0 or 1. Remove the unnecessary BUG_ON()
checks.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
H Hartley Sweeten 2015-05-01 15:00:02 -07:00 committed by Greg Kroah-Hartman
parent 25e941affe
commit 3446b08e83
2 changed files with 0 additions and 4 deletions

View file

@ -686,7 +686,6 @@ static int ni_request_gpct_mite_channel(struct comedi_device *dev,
unsigned long flags; unsigned long flags;
struct mite_channel *mite_chan; struct mite_channel *mite_chan;
BUG_ON(gpct_index >= NUM_GPCT);
spin_lock_irqsave(&devpriv->mite_channel_lock, flags); spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
BUG_ON(devpriv->counter_dev->counters[gpct_index].mite_chan); BUG_ON(devpriv->counter_dev->counters[gpct_index].mite_chan);
mite_chan = mite_chan =
@ -770,7 +769,6 @@ static void ni_release_gpct_mite_channel(struct comedi_device *dev,
struct ni_private *devpriv = dev->private; struct ni_private *devpriv = dev->private;
unsigned long flags; unsigned long flags;
BUG_ON(gpct_index >= NUM_GPCT);
spin_lock_irqsave(&devpriv->mite_channel_lock, flags); spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
if (devpriv->counter_dev->counters[gpct_index].mite_chan) { if (devpriv->counter_dev->counters[gpct_index].mite_chan) {
struct mite_channel *mite_chan = struct mite_channel *mite_chan =

View file

@ -605,14 +605,12 @@ static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
static inline unsigned GPCT_DMA_Select_Bits(unsigned gpct_index, static inline unsigned GPCT_DMA_Select_Bits(unsigned gpct_index,
unsigned mite_channel) unsigned mite_channel)
{ {
BUG_ON(gpct_index > 1);
return ni_stc_dma_channel_select_bitfield(mite_channel) << (4 * return ni_stc_dma_channel_select_bitfield(mite_channel) << (4 *
gpct_index); gpct_index);
} }
static inline unsigned GPCT_DMA_Select_Mask(unsigned gpct_index) static inline unsigned GPCT_DMA_Select_Mask(unsigned gpct_index)
{ {
BUG_ON(gpct_index > 1);
return 0xf << (4 * gpct_index); return 0xf << (4 * gpct_index);
} }