diff options
author | H Hartley Sweeten <[email protected]> | 2014-07-24 10:14:35 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2014-07-27 11:16:47 -0700 |
commit | 72f4202f1ff20edfcc34368488d5bd760fac57b6 (patch) | |
tree | 78af7780f413b9d0a69de76901a05635a9b87f59 | |
parent | 1649d56d92ff85b56c7af9b385fa729487277e94 (diff) |
staging: comedi: ni_tio: convert NI_660x_Gate_Pin_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 | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c index e6b813489116..818519a72f76 100644 --- a/drivers/staging/comedi/drivers/ni_tio.c +++ b/drivers/staging/comedi/drivers/ni_tio.c @@ -159,11 +159,7 @@ enum ni_660x_gate_select { NI_660x_Logic_Low_Gate_Select = 0x1f, }; static const unsigned ni_660x_max_gate_pin = 7; -static inline unsigned NI_660x_Gate_Pin_Gate_Select(unsigned n) -{ - BUG_ON(n > ni_660x_max_gate_pin); - return 0x2 + n; -} +#define NI_660X_PIN_GATE_SEL(x) (0x2 + (x)) static inline unsigned NI_660x_RTSI_Gate_Select(unsigned n) { @@ -1225,8 +1221,7 @@ ni_660x_first_gate_to_generic_gate_source(unsigned ni_660x_gate_select) if (i <= ni_660x_max_rtsi_channel) break; for (i = 0; i <= ni_660x_max_gate_pin; ++i) { - if (ni_660x_gate_select == - NI_660x_Gate_Pin_Gate_Select(i)) + if (ni_660x_gate_select == NI_660X_PIN_GATE_SEL(i)) return NI_GPCT_GATE_PIN_GATE_SELECT(i); } if (i <= ni_660x_max_gate_pin) |