From: H Hartley Sweeten Date: Fri, 1 May 2015 21:58:49 +0000 (-0700) Subject: staging: comedi: ni_mio_common: remove BUG() check in ni_cdio_cmd() X-Git-Tag: v4.2-rc1~88^2~737 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b9abc4aa75197f48d54092f36576249312dff55a;p=karo-tx-linux.git staging: comedi: ni_mio_common: remove BUG() check in ni_cdio_cmd() The cmd->scan_begin_src was validated in ni_cdio_cmdtest() and can only be TRIG_EXT. Remove the switch statement and unnecessary BUG() check. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index acba13847c29..cbfbfa5ab752 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -3460,16 +3460,8 @@ static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s) int retval; ni_writel(dev, NI_M_CDO_CMD_RESET, NI_M_CDIO_CMD_REG); - switch (cmd->scan_begin_src) { - case TRIG_EXT: - cdo_mode_bits |= - CR_CHAN(cmd->scan_begin_arg) & - CDO_Sample_Source_Select_Mask; - break; - default: - BUG(); - break; - } + cdo_mode_bits |= CR_CHAN(cmd->scan_begin_arg) & + CDO_Sample_Source_Select_Mask; if (cmd->scan_begin_arg & CR_INVERT) cdo_mode_bits |= CDO_Polarity_Bit; ni_writel(dev, cdo_mode_bits, NI_M_CDO_MODE_REG);