gpio: kempld: use BIT() macro instead of shifting bits
authorJavier Martinez Canillas <javier@dowhile0.org>
Sun, 27 Apr 2014 00:00:48 +0000 (02:00 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Sat, 3 May 2014 19:16:07 +0000 (12:16 -0700)
Using the BIT() macro instead of shifting bits
makes the code less error prone and also more readable.

Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-kempld.c

index ebe1023..1e5e519 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/mfd/kempld.h>
 
 #define KEMPLD_GPIO_MAX_NUM            16
-#define KEMPLD_GPIO_MASK(x)            (1 << ((x) % 8))
+#define KEMPLD_GPIO_MASK(x)            (BIT((x) % 8))
 #define KEMPLD_GPIO_DIR_NUM(x)         (0x40 + (x) / 8)
 #define KEMPLD_GPIO_LVL_NUM(x)         (0x42 + (x) / 8)
 #define KEMPLD_GPIO_EVT_LVL_EDGE       0x46