summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-acpi.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-11-09 23:53:31 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-11-16 15:14:35 +0300
commit2c4d00cb8fc5e01004eb2e84d13c09a2d9ecab0f (patch)
treed6bcbd51b05f7ee45367bf37d8e51afe14d6db33 /drivers/gpio/gpiolib-acpi.c
parent74301f2781586d0e6669466b2b4d59d94c63fa5a (diff)
downloadlinux-2c4d00cb8fc5e01004eb2e84d13c09a2d9ecab0f.tar.xz
gpiolib: acpi: Use BIT() macro to increase readability
We may use BIT() macro to increase readability in acpi_gpio_adr_space_handler(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/gpio/gpiolib-acpi.c')
-rw-r--r--drivers/gpio/gpiolib-acpi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index a556e2ec0a39..6cc5f91bfe2e 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -1101,8 +1101,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
mutex_unlock(&achip->conn_lock);
if (function == ACPI_WRITE)
- gpiod_set_raw_value_cansleep(desc,
- !!((1 << i) & *value));
+ gpiod_set_raw_value_cansleep(desc, !!(*value & BIT(i)));
else
*value |= (u64)gpiod_get_raw_value_cansleep(desc) << i;
}