diff options
author | H Hartley Sweeten <[email protected]> | 2014-07-24 10:14:41 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2014-07-27 11:16:47 -0700 |
commit | ff9a9861154e5f8cebeb981b86ee194cfef00ede (patch) | |
tree | 4843848f4ec7e66609b7368bedd11b78055b2e52 | |
parent | 288cb1a87c63ab4df05936c8842474c9b5530af4 (diff) |
staging: comedi: ni_tio: convert NI_660x_RTSI_Second_Gate_Select() to a macro
The BUG_ON() in this function can never happen.
For aesthetics, rename this CamelCase inline function and convert it into
a simple macro.
Signed-off-by: H Hartley Sweeten <[email protected]>
Reviewed-by: Ian Abbott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_tio.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c index 422052ffda7d..234761225081 100644 --- a/drivers/staging/comedi/drivers/ni_tio.c +++ b/drivers/staging/comedi/drivers/ni_tio.c @@ -192,11 +192,7 @@ static inline unsigned NI_660x_Up_Down_Pin_Second_Gate_Select(unsigned n) return 0x2 + n; } -static inline unsigned NI_660x_RTSI_Second_Gate_Select(unsigned n) -{ - BUG_ON(n > ni_660x_max_rtsi_channel); - return 0xb + n; -} +#define NI_660X_RTSI_GATE2_SEL(x) (0xb + (x)) static const unsigned int counter_status_mask = COMEDI_COUNTER_ARMED | COMEDI_COUNTER_COUNTING; @@ -1267,10 +1263,8 @@ ni_660x_second_gate_to_generic_gate_source(unsigned ni_660x_gate_select) return NI_GPCT_LOGIC_LOW_GATE_SELECT; default: for (i = 0; i <= ni_660x_max_rtsi_channel; ++i) { - if (ni_660x_gate_select == - NI_660x_RTSI_Second_Gate_Select(i)) { + if (ni_660x_gate_select == NI_660X_RTSI_GATE2_SEL(i)) return NI_GPCT_RTSI_GATE_SELECT(i); - } } if (i <= ni_660x_max_rtsi_channel) break; |