staging: comedi: ni_tio: convert NI_660x_Gate_Pin_Gate_Select() to a macro
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 24 Jul 2014 17:14:35 +0000 (10:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Jul 2014 18:16:47 +0000 (11:16 -0700)
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 <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_tio.c

index e6b81348911684e1b6baa433e3062d127af9cd7e..818519a72f76614ffe120be13ffa0c9bc62e8291 100644 (file)
@@ -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)