Skip to contentSkip to conversation

comedi: cb_pcidda: Fix coding style - use BIT macro

PATCH In review Ranjith Thangavel 3 participants 3 messages Nov 11, 2015 – Nov 12, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 comedi: cb_pcidda: Fix coding style - use BIT macro

BIT macro is used for defining BIT location instead of shifting operator - coding style issue

---
 drivers/staging/comedi/drivers/cb_pcidda.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/cb_pcidda.c +3 -3
index b00a36a..ccb37d1 100644
@@ -51,13 +51,13 @@
 
 /* DAC registers */
 #define CB_DDA_DA_CTRL_REG		0x00	   /* D/A Control Register  */
-#define CB_DDA_DA_CTRL_SU		(1 << 0)   /*  Simultaneous update  */
-#define CB_DDA_DA_CTRL_EN		(1 << 1)   /*  Enable specified DAC */
+#define CB_DDA_DA_CTRL_SU		BIT(0)   /*  Simultaneous update  */
+#define CB_DDA_DA_CTRL_EN		BIT(1)   /*  Enable specified DAC */
 #define CB_DDA_DA_CTRL_DAC(x)		((x) << 2) /*  Specify DAC channel  */
 #define CB_DDA_DA_CTRL_RANGE2V5		(0 << 6)   /*  2.5V range           */
 #define CB_DDA_DA_CTRL_RANGE5V		(2 << 6)   /*  5V range             */
 #define CB_DDA_DA_CTRL_RANGE10V		(3 << 6)   /*  10V range            */
-#define CB_DDA_DA_CTRL_UNIP		(1 << 8)   /*  Unipolar range       */
+#define CB_DDA_DA_CTRL_UNIP		BIT(8)   /*  Unipolar range       */
 
 #define DACALIBRATION1	4	/*  D/A CALIBRATION REGISTER 1 */
 /* write bits */
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Ranjith Thangavel

BIT macro is used for defining BIT location instead of shifting operator - coding style issue

---
  drivers/staging/comedi/drivers/cb_pcidda.c |    6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/cb_pcidda.c +1 -2
index b00a36a..ccb37d1 100644
@@ -51,13 +51,13 @@
 
  /* DAC registers */
  #define CB_DDA_DA_CTRL_REG		0x00	   /* D/A Control Register  */
-#define CB_DDA_DA_CTRL_SU		(1 << 0)   /*  Simultaneous update  */
-#define CB_DDA_DA_CTRL_EN		(1 << 1)   /*  Enable specified DAC */
+#define CB_DDA_DA_CTRL_SU		BIT(0)   /*  Simultaneous update  */

drivers/staging/comedi/drivers/cb_pcidda.c line 63

Quoted 10 lines
drivers/staging/comedi/drivers/cb_pcidda.c +2 -1
+#define CB_DDA_DA_CTRL_EN		BIT(1)   /*  Enable specified DAC */
  #define CB_DDA_DA_CTRL_DAC(x)		((x) << 2) /*  Specify DAC channel  */
  #define CB_DDA_DA_CTRL_RANGE2V5		(0 << 6)   /*  2.5V range           */
  #define CB_DDA_DA_CTRL_RANGE5V		(2 << 6)   /*  5V range             */
  #define CB_DDA_DA_CTRL_RANGE10V		(3 << 6)   /*  10V range            */
-#define CB_DDA_DA_CTRL_UNIP		(1 << 8)   /*  Unipolar range       */
+#define CB_DDA_DA_CTRL_UNIP		BIT(8)   /*  Unipolar range       */
 
  #define DACALIBRATION1	4	/*  D/A CALIBRATION REGISTER 1 */
  /* write bits */

Thanks!

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