staging: comedi: adv_pci1724: prefer using the BIT macro
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 9 Oct 2015 20:07:04 +0000 (13:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 04:26:38 +0000 (21:26 -0700)
As suggested by checkpatch.pl, use the BIT macro to define the
register bits.

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/adv_pci1724.c

index 9677111f9ab24b67f3063d40d08b12b7c24ee8e2..bf6a8f10118c9e9aef2f6454cbcb54d638a45450 100644 (file)
  * PCI bar 2 Register I/O map (dev->iobase)
  */
 #define PCI1724_DAC_CTRL_REG           0x00
-#define PCI1724_DAC_CTRL_GX(x)         (1 << (20 + ((x) / 8)))
+#define PCI1724_DAC_CTRL_GX(x)         BIT(20 + ((x) / 8))
 #define PCI1724_DAC_CTRL_CX(x)         (((x) % 8) << 16)
-#define PCI1724_DAC_CTRL_MODE_GAIN     (1 << 14)
-#define PCI1724_DAC_CTRL_MODE_OFFSET   (2 << 14)
-#define PCI1724_DAC_CTRL_MODE_NORMAL   (3 << 14)
-#define PCI1724_DAC_CTRL_MODE_MASK     (3 << 14)
+#define PCI1724_DAC_CTRL_MODE(x)       (((x) & 0x3) << 14)
+#define PCI1724_DAC_CTRL_MODE_GAIN     PCI1724_DAC_CTRL_MODE(1)
+#define PCI1724_DAC_CTRL_MODE_OFFSET   PCI1724_DAC_CTRL_MODE(2)
+#define PCI1724_DAC_CTRL_MODE_NORMAL   PCI1724_DAC_CTRL_MODE(3)
+#define PCI1724_DAC_CTRL_MODE_MASK     PCI1724_DAC_CTRL_MODE(3)
 #define PCI1724_DAC_CTRL_DATA(x)       (((x) & 0x3fff) << 0)
 #define PCI1724_SYNC_CTRL_REG          0x04
-#define PCI1724_SYNC_CTRL_DACSTAT      (1 << 1)
-#define PCI1724_SYNC_CTRL_SYN          (1 << 0)
+#define PCI1724_SYNC_CTRL_DACSTAT      BIT(1)
+#define PCI1724_SYNC_CTRL_SYN          BIT(0)
 #define PCI1724_EEPROM_CTRL_REG                0x08
 #define PCI1724_SYNC_TRIG_REG          0x0c  /* any value works */
 #define PCI1724_BOARD_ID_REG           0x10