From e0f6959fbb318c1fb08c79503815b2cdd79d7554 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 23 Oct 2012 16:28:14 -0700 Subject: [PATCH] staging: comedi: ni_660x: remove BUG_ON(chan >= NUM_PFI_CHANNELS) 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 Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_660x.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 25459860b46a..3f8ac5668252 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -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)) @@ -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]; } -- 2.34.1