提交 5f077644 编写于 作者: J Javier Martinez Canillas 提交者: Linus Walleij

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: NJavier Martinez Canillas <javier@dowhile0.org>
Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 f9748ef1
......@@ -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 */
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册