i2c: rcar: refactor private flags
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 8 Aug 2018 07:59:27 +0000 (09:59 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 20 Aug 2018 12:49:24 +0000 (14:49 +0200)
Use BIT macro to avoid shift-31-problem, indent a little more and use
GENMASK to make it easier to add new flags.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-rcar.c

index 791a4aa34fdd4e5100790352a55a4912729438b9..a9f1880e2eaef16fcd4eb9548c155be4e077c503 100644 (file)
@@ -19,6 +19,7 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
+#include <linux/bitops.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/dmaengine.h>
 #define ID_ARBLOST     (1 << 3)
 #define ID_NACK                (1 << 4)
 /* persistent flags */
-#define ID_P_NO_RXDMA  (1 << 30) /* HW forbids RXDMA sometimes */
-#define ID_P_PM_BLOCKED        (1 << 31)
-#define ID_P_MASK      (ID_P_PM_BLOCKED | ID_P_NO_RXDMA)
+#define ID_P_NO_RXDMA          BIT(30) /* HW forbids RXDMA sometimes */
+#define ID_P_PM_BLOCKED                BIT(31)
+#define ID_P_MASK              GENMASK(31, 30)
 
 enum rcar_i2c_type {
        I2C_RCAR_GEN1,