Bläddra i källkod

gpio: em: use BIT() macro instead of shifting bits

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>
Javier Martinez Canillas 11 år sedan
förälder
incheckning
5f077644b9
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      drivers/gpio/gpio-em.c

+ 1 - 1
drivers/gpio/gpio-em.c

@@ -212,7 +212,7 @@ static void __em_gio_set(struct gpio_chip *chip, unsigned int reg,
 {
 {
 	/* upper 16 bits contains mask and lower 16 actual value */
 	/* upper 16 bits contains mask and lower 16 actual value */
 	em_gio_write(gpio_to_priv(chip), reg,
 	em_gio_write(gpio_to_priv(chip), reg,
-		     (1 << (shift + 16)) | (value << shift));
+		     (BIT(shift + 16)) | (value << shift));
 }
 }
 
 
 static void em_gio_set(struct gpio_chip *chip, unsigned offset, int value)
 static void em_gio_set(struct gpio_chip *chip, unsigned offset, int value)