staging: comedi: ni_tio: tidy up Gi_Reset_Bit
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 28 Jul 2014 17:26:54 +0000 (10:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jul 2014 23:51:00 +0000 (16:51 -0700)
Convert this inline CamelCase function into a define.

For aesthetics, move the new define so it is associated with the
register 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 ccdf96ed653919c5fac9104ed9e320b5e20b7eb4..fb7b271ac2a32bc0b254089e9dffdc42b0fb284c 100644 (file)
@@ -184,7 +184,7 @@ static void ni_tio_reset_count_and_disarm(struct ni_gpct *counter)
 {
        unsigned cidx = counter->counter_index;
 
-       write_register(counter, Gi_Reset_Bit(cidx), NITIO_RESET_REG(cidx));
+       write_register(counter, GI_RESET(cidx), NITIO_RESET_REG(cidx));
 }
 
 static uint64_t ni_tio_clock_period_ps(const struct ni_gpct *counter,
index 37fde62b0d6e88a6940f586958c26f640d9a15bf..ea1c9fb269af1065af89d1dbb753a69fbdbd52a3 100644 (file)
 #define GI_TC_ERROR(x)                 (((x) % 2) ? (1 << 13) : (1 << 12))
 #define GI_GATE_ERROR(x)               (((x) % 2) ? (1 << 15) : (1 << 14))
 #define NITIO_RESET_REG(x)             (NITIO_G01_RESET + ((x) / 2))
+#define GI_RESET(x)                    (1 << (2 + ((x) % 2)))
 #define NITIO_STATUS1_REG(x)           (NITIO_G01_STATUS1 + ((x) / 2))
 #define NITIO_STATUS2_REG(x)           (NITIO_G01_STATUS2 + ((x) / 2))
 #define NITIO_DMA_CFG_REG(x)           (NITIO_G0_DMA_CFG + (x))
 #define NITIO_STATUS_REG(x)            (NITIO_G0_STATUS + (x))
 #define NITIO_INT_ENA_REG(x)           (NITIO_G0_INT_ENA + (x))
 
-/* joint reset register bits */
-static inline unsigned Gi_Reset_Bit(unsigned counter_index)
-{
-       return 0x1 << (2 + (counter_index % 2));
-}
-
 enum Gxx_Joint_Status2_Bits {
        G0_Output_Bit = 0x1,
        G1_Output_Bit = 0x2,
This page took 0.026398 seconds and 5 git commands to generate.