diff options
author | H Hartley Sweeten | 2016-04-14 18:58:02 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-04-29 07:17:28 +0200 |
commit | 2e2f7b70374bc420d4695675ccc5b35756badef6 (patch) | |
tree | ded7b17f8700c3f3821bbef625f12b1fc253aac9 /drivers/staging/comedi | |
parent | staging: comedi: ni_mio_common: tidy up AO scan begin (diff) | |
download | kernel-qcow2-linux-2e2f7b70374bc420d4695675ccc5b35756badef6.tar.gz kernel-qcow2-linux-2e2f7b70374bc420d4695675ccc5b35756badef6.tar.xz kernel-qcow2-linux-2e2f7b70374bc420d4695675ccc5b35756badef6.zip |
staging: comedi: ni_mio_common: tidy up ni_gpct_write_register()
The 'bits' value passed to this function is properly set by the callers
so the BUG_ON() can never occur when writing to the NITIO_G[01]_INT_ENA
and NITIO_G01_RESET registers. Remove the BUG_ON() checks.
For aesthetic, also remove the static const variables. They don't add
any additional clarity.
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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_mio_common.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 1e2e89fccb5b..559efb43b971 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -3993,10 +3993,6 @@ static void ni_gpct_write_register(struct ni_gpct *counter, unsigned int bits, { struct comedi_device *dev = counter->counter_dev->dev; unsigned int stc_register = ni_gpct_to_stc_register(dev, reg); - static const unsigned int gpct_interrupt_a_enable_mask = - NISTC_INTA_ENA_G0_GATE | NISTC_INTA_ENA_G0_TC; - static const unsigned int gpct_interrupt_b_enable_mask = - NISTC_INTB_ENA_G1_GATE | NISTC_INTB_ENA_G1_TC; if (stc_register == 0) return; @@ -4024,18 +4020,15 @@ static void ni_gpct_write_register(struct ni_gpct *counter, unsigned int bits, /* 16 bit registers */ case NITIO_G0_INT_ENA: - BUG_ON(bits & ~gpct_interrupt_a_enable_mask); ni_set_bitfield(dev, stc_register, - gpct_interrupt_a_enable_mask, bits); + NISTC_INTA_ENA_G0_GATE | NISTC_INTA_ENA_G0_TC, + bits); break; case NITIO_G1_INT_ENA: - BUG_ON(bits & ~gpct_interrupt_b_enable_mask); ni_set_bitfield(dev, stc_register, - gpct_interrupt_b_enable_mask, bits); + NISTC_INTB_ENA_G1_GATE | NISTC_INTB_ENA_G1_TC, + bits); break; - case NITIO_G01_RESET: - BUG_ON(bits & ~(NISTC_RESET_G0 | NISTC_RESET_G1)); - /* fall-through */ default: ni_stc_writew(dev, bits, stc_register); } |