On 07/10/15 01:35, H Hartley Sweeten wrote:
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 <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
  drivers/staging/comedi/drivers/ke_counter.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ke_counter.c 
b/drivers/staging/comedi/drivers/ke_counter.c
index dc642ed..93198ab 100644
--- a/drivers/staging/comedi/drivers/ke_counter.c
+++ b/drivers/staging/comedi/drivers/ke_counter.c
@@ -41,9 +41,10 @@
  #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,


Reviewed-by: Ian Abbott <abbo...@mev.co.uk>

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to