aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <[email protected]>2014-07-24 10:14:40 -0700
committerGreg Kroah-Hartman <[email protected]>2014-07-27 11:16:47 -0700
commit288cb1a87c63ab4df05936c8842474c9b5530af4 (patch)
treeb3c316aa316a8af9a54b307ee798023eb452ec38
parentcdf4fce4211be5af3915a10f2ea9a28d2696c2cb (diff)
staging: comedi: ni_tio: convert NI_660x_RTSI_Clock() 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.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c
index a7cd59b7e8de..422052ffda7d 100644
--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -120,11 +120,7 @@ enum ni_660x_clock_source {
NI_660x_Logic_Low_Clock = 0x1f,
};
static const unsigned ni_660x_max_rtsi_channel = 6;
-static inline unsigned NI_660x_RTSI_Clock(unsigned n)
-{
- BUG_ON(n > ni_660x_max_rtsi_channel);
- return 0xb + n;
-}
+#define NI_660X_RTSI_CLK(x) (0xb + (x))
static const unsigned ni_660x_max_source_pin = 7;
#define NI_660X_SRC_PIN_CLK(x) (0x2 + (x))
@@ -527,7 +523,7 @@ static unsigned ni_660x_source_select_bits(unsigned int clock_source)
default:
for (i = 0; i <= ni_660x_max_rtsi_channel; ++i) {
if (clock_select_bits == NI_GPCT_RTSI_CLOCK_SRC_BITS(i)) {
- ni_660x_clock = NI_660x_RTSI_Clock(i);
+ ni_660x_clock = NI_660X_RTSI_CLK(i);
break;
}
}
@@ -810,7 +806,7 @@ static unsigned ni_660x_clock_src_select(const struct ni_gpct *counter)
break;
default:
for (i = 0; i <= ni_660x_max_rtsi_channel; ++i) {
- if (input_select == NI_660x_RTSI_Clock(i)) {
+ if (input_select == NI_660X_RTSI_CLK(i)) {
clock_source = NI_GPCT_RTSI_CLOCK_SRC_BITS(i);
break;
}