Skip to contentSkip to conversation

staging: comedi: dt2801: Prefer using the BIT macro

PATCH In review Bhaktipriya Shridhar 2 participants 2 messages Jan 11, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: comedi: dt2801: Prefer using the BIT macro

As suggested by checkpatch.pl, this patch replaces bit shifting on 1 with the BIT(x) macro.

---
 drivers/staging/comedi/drivers/dt2801.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/comedi/drivers/dt2801.c +9 -9
index 80e38de..6c7b4d2 100644
@@ -68,17 +68,17 @@ Configuration options:
 /* Command modifiers (only used with read/write), EXTTRIG can be
    used with some other commands.
 */
-#define DT_MOD_DMA     (1<<4)
-#define DT_MOD_CONT    (1<<5)
-#define DT_MOD_EXTCLK  (1<<6)
-#define DT_MOD_EXTTRIG (1<<7)
+#define DT_MOD_DMA     BIT(4)
+#define DT_MOD_CONT    BIT(5)
+#define DT_MOD_EXTCLK  BIT(6)
+#define DT_MOD_EXTTRIG BIT(7)
 
 /* Bits in status register */
-#define DT_S_DATA_OUT_READY   (1<<0)
-#define DT_S_DATA_IN_FULL     (1<<1)
-#define DT_S_READY            (1<<2)
-#define DT_S_COMMAND          (1<<3)
-#define DT_S_COMPOSITE_ERROR  (1<<7)
+#define DT_S_DATA_OUT_READY   BIT(0)
+#define DT_S_DATA_IN_FULL     BIT(1)
+#define DT_S_READY            BIT(2)
+#define DT_S_COMMAND          BIT(3)
+#define DT_S_COMPOSITE_ERROR  BIT(7)
 
 /* registers */
 #define DT2801_DATA		0

--
2.1.4

Reviewed-by on v1 1/1
#1 lore raw
Quoted 40 lines · Bhaktipriya Shridhar

As suggested by checkpatch.pl, this patch replaces bit shifting on 1 with the BIT(x) macro.

---
  drivers/staging/comedi/drivers/dt2801.c | 18 +++++++++---------
  1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/comedi/drivers/dt2801.c +9 -10
index 80e38de..6c7b4d2 100644
@@ -68,17 +68,17 @@ Configuration options:
  /* Command modifiers (only used with read/write), EXTTRIG can be
     used with some other commands.
  */
-#define DT_MOD_DMA     (1<<4)
-#define DT_MOD_CONT    (1<<5)
-#define DT_MOD_EXTCLK  (1<<6)
-#define DT_MOD_EXTTRIG (1<<7)
+#define DT_MOD_DMA     BIT(4)
+#define DT_MOD_CONT    BIT(5)
+#define DT_MOD_EXTCLK  BIT(6)
+#define DT_MOD_EXTTRIG BIT(7)
 
  /* Bits in status register */
-#define DT_S_DATA_OUT_READY   (1<<0)
-#define DT_S_DATA_IN_FULL     (1<<1)
-#define DT_S_READY            (1<<2)
-#define DT_S_COMMAND          (1<<3)
-#define DT_S_COMPOSITE_ERROR  (1<<7)
+#define DT_S_DATA_OUT_READY   BIT(0)
+#define DT_S_DATA_IN_FULL     BIT(1)
+#define DT_S_READY            BIT(2)
+#define DT_S_COMMAND          BIT(3)
+#define DT_S_COMPOSITE_ERROR  BIT(7)
 
  /* registers */
  #define DT2801_DATA		0
--
Quoted 2 lines

2.1.4

Thanks!

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-