diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2016-04-14 16:57:59 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-29 05:17:28 (GMT) |
commit | 0b235d5ce4e084535e27e0416449d3c3b0d133ea (patch) | |
tree | 21503805e40b0409ab82c325006b182c0033646e | |
parent | 73894987d6747f39fe7a08b5b25d33a2883d09e2 (diff) | |
download | linux-0b235d5ce4e084535e27e0416449d3c3b0d133ea.tar.xz |
staging: comedi: ni_mio_common: convert NI_GPCT_SUBDEV to a macro
The 'counter_index' is always in range (0 to < NUM_GPCT, which is 2).
For aesthetics, convert this inline function into a macro and remove
the BUG() which can never occur.
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>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_mio_common.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index c56a518..8c2c4f6 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -214,19 +214,7 @@ enum ni_common_subdevices { NI_NUM_SUBDEVICES }; -static inline unsigned int NI_GPCT_SUBDEV(unsigned int counter_index) -{ - switch (counter_index) { - case 0: - return NI_GPCT0_SUBDEV; - case 1: - return NI_GPCT1_SUBDEV; - default: - break; - } - BUG(); - return NI_GPCT0_SUBDEV; -} +#define NI_GPCT_SUBDEV(x) (NI_GPCT0_SUBDEV + (x)) enum timebase_nanoseconds { TIMEBASE_1_NS = 50, |