staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Autoincrement_Reg()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 19 Dec 2013 23:31:34 +0000 (16:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Dec 2013 19:49:31 +0000 (11:49 -0800)
The "AutoIncrement" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

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
drivers/staging/comedi/drivers/ni_tio_internal.h

index cf8892bcf01e83a8015cfa2b12b515641d29c72d..6fa72f00360a8d71d81d92cb5ddf3cb605247250 100644 (file)
@@ -372,12 +372,12 @@ void ni_tio_init_counter(struct ni_gpct *counter)
 
        ni_tio_reset_count_and_disarm(counter);
        /* initialize counter registers */
-       counter_dev->regs[NITIO_Gi_Autoincrement_Reg(counter->counter_index)] =
+       counter_dev->regs[NITIO_AUTO_INC_REG(counter->counter_index)] =
            0x0;
        write_register(counter,
                       counter_dev->
-                      regs[NITIO_Gi_Autoincrement_Reg(counter->counter_index)],
-                      NITIO_Gi_Autoincrement_Reg(counter->counter_index));
+                      regs[NITIO_AUTO_INC_REG(counter->counter_index)],
+                      NITIO_AUTO_INC_REG(counter->counter_index));
        ni_tio_set_bits(counter, NITIO_Gi_Command_Reg(counter->counter_index),
                        ~0, Gi_Synchronize_Gate_Bit);
        ni_tio_set_bits(counter, NITIO_Gi_Mode_Reg(counter->counter_index), ~0,
index 88d51e4cdd899270558394d563ee64c549d1f5e3..5d3899fb17eb5bcda71df920c216a122fedcbad9 100644 (file)
 
 #include "ni_tio.h"
 
-static inline enum ni_gpct_register NITIO_Gi_Autoincrement_Reg(unsigned idx)
-{
-       switch (idx) {
-       case 0:
-               return NITIO_G0_AUTO_INC;
-       case 1:
-               return NITIO_G1_AUTO_INC;
-       case 2:
-               return NITIO_G2_AUTO_INC;
-       case 3:
-               return NITIO_G3_AUTO_INC;
-       }
-       return 0;
-}
+#define NITIO_AUTO_INC_REG(x)          (NITIO_G0_AUTO_INC + (x))
 
 static inline enum ni_gpct_register NITIO_Gi_Command_Reg(unsigned idx)
 {