summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/acmacros.h
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2016-03-24 09:40:56 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-04-05 03:53:33 +0200
commita8d1e1c063b0b1c91a9415f5cb09e37a75bce809 (patch)
treea7b90d0700afc06d868a4283c897f02aa2d5289c /drivers/acpi/acpica/acmacros.h
parent7447bc1e69bafab72ef69a7f054bb1e5f9ff908d (diff)
downloadblackbird-op-linux-a8d1e1c063b0b1c91a9415f5cb09e37a75bce809.tar.gz
blackbird-op-linux-a8d1e1c063b0b1c91a9415f5cb09e37a75bce809.zip
ACPICA: Utilities: Add ACPI_IS_POWER_OF_TWO()
ACPICA commit cbcb77565c5032dd48e19b3a8a8b8704c5f29faf This patch adds a macro ACPI_IS_POWER_OF_TWO, which can be used to detect if a number is a power of two. Lv Zheng. Link: https://github.com/acpica/acpica/commit/cbcb7756 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/acmacros.h')
-rw-r--r--drivers/acpi/acpica/acmacros.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 411c18b7d541..b461f5568e8c 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -260,6 +260,10 @@
#define ACPI_IS_MISALIGNED(value) (((acpi_size) value) & (sizeof(acpi_size)-1))
+/* Generic (power-of-two) rounding */
+
+#define ACPI_IS_POWER_OF_TWO(a) (((a) & ((a) - 1)) == 0)
+
/*
* Bitmask creation
* Bit positions start at zero.
OpenPOWER on IntegriCloud