]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
i2c: iproc: Change driver to use 'BIT' macro
authorRay Jui <ray.jui@broadcom.com>
Wed, 3 Apr 2019 21:05:35 +0000 (14:05 -0700)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 23 Apr 2019 21:36:00 +0000 (23:36 +0200)
Change the iProc I2C driver to use the 'BIT' macro from all '1 << XXX'
bit operations to get rid of compiler warning and improve readability of
the code

Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-bcm-iproc.c

index 562942d0c05c58ed36de361ad99bb99441de4446..a845b8decac8fe22ce5afd36a254b4de6f5eb1ad 100644 (file)
@@ -717,7 +717,7 @@ static int bcm_iproc_i2c_xfer_single_msg(struct bcm_iproc_i2c_dev *iproc_i2c,
 
                        /* mark the last byte */
                        if (i == msg->len - 1)
-                               val |= 1 << M_TX_WR_STATUS_SHIFT;
+                               val |= BIT(M_TX_WR_STATUS_SHIFT);
 
                        iproc_i2c_wr_reg(iproc_i2c, M_TX_OFFSET, val);
                }
@@ -844,7 +844,7 @@ static int bcm_iproc_i2c_cfg_speed(struct bcm_iproc_i2c_dev *iproc_i2c)
 
        iproc_i2c->bus_speed = bus_speed;
        val = iproc_i2c_rd_reg(iproc_i2c, TIM_CFG_OFFSET);
-       val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
+       val &= ~BIT(TIM_CFG_MODE_400_SHIFT);
        val |= (bus_speed == 400000) << TIM_CFG_MODE_400_SHIFT;
        iproc_i2c_wr_reg(iproc_i2c, TIM_CFG_OFFSET, val);
 
@@ -995,7 +995,7 @@ static int bcm_iproc_i2c_resume(struct device *dev)
 
        /* configure to the desired bus speed */
        val = iproc_i2c_rd_reg(iproc_i2c, TIM_CFG_OFFSET);
-       val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
+       val &= ~BIT(TIM_CFG_MODE_400_SHIFT);
        val |= (iproc_i2c->bus_speed == 400000) << TIM_CFG_MODE_400_SHIFT;
        iproc_i2c_wr_reg(iproc_i2c, TIM_CFG_OFFSET, val);