Commit 0b235d5c authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 73894987
...@@ -214,19 +214,7 @@ enum ni_common_subdevices { ...@@ -214,19 +214,7 @@ enum ni_common_subdevices {
NI_NUM_SUBDEVICES NI_NUM_SUBDEVICES
}; };
static inline unsigned int NI_GPCT_SUBDEV(unsigned int counter_index) #define NI_GPCT_SUBDEV(x) (NI_GPCT0_SUBDEV + (x))
{
switch (counter_index) {
case 0:
return NI_GPCT0_SUBDEV;
case 1:
return NI_GPCT1_SUBDEV;
default:
break;
}
BUG();
return NI_GPCT0_SUBDEV;
}
enum timebase_nanoseconds { enum timebase_nanoseconds {
TIMEBASE_1_NS = 50, TIMEBASE_1_NS = 50,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment