staging: comedi: ke_counter: prefer using the BIT macro
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 7 Oct 2015 00:35:18 +0000 (17:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 04:24:11 +0000 (21:24 -0700)
Use a macro to define the clock source options. This fixes the
checkpatch.pl issue about:

CHECK: Prefer using the BIT 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/ke_counter.c

index dc642edf4f655c7ae7eeee6473c937445dcda901..93198abf0ee54293ca3098948cb5d64324ae6ef0 100644 (file)
 #define KE_MSB_REG(x)                  (0x0c + ((x) * 0x20))
 #define KE_SIGN_REG(x)                 (0x10 + ((x) * 0x20))
 #define KE_OSC_SEL_REG                 0xf8
-#define KE_OSC_SEL_EXT                 (1 << 0)
-#define KE_OSC_SEL_4MHZ                        (2 << 0)
-#define KE_OSC_SEL_20MHZ               (3 << 0)
+#define KE_OSC_SEL_CLK(x)              (((x) & 0x3) << 0)
+#define KE_OSC_SEL_EXT                 KE_OSC_SEL_CLK(1)
+#define KE_OSC_SEL_4MHZ                        KE_OSC_SEL_CLK(2)
+#define KE_OSC_SEL_20MHZ               KE_OSC_SEL_CLK(3)
 #define KE_DO_REG                      0xfc
 
 static int ke_counter_insn_write(struct comedi_device *dev,