ACPICA: Utilities: Add ACPI_IS_ALIGNED() macro
authorLv Zheng <lv.zheng@intel.com>
Thu, 5 May 2016 04:58:32 +0000 (12:58 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 5 May 2016 13:22:27 +0000 (15:22 +0200)
This patch introduces ACPI_IS_ALIGNED() macro. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/acmacros.h

index 73f6653c848d6895c07b7edc7001eb629c8cbea7..ecbaabae59e7bec75d1f5f1cf1f95a621dda643c 100644 (file)
 
 /* Generic (power-of-two) rounding */
 
-#define ACPI_IS_POWER_OF_TWO(a)             (((a) & ((a) - 1)) == 0)
+#define ACPI_IS_ALIGNED(a, s)               (((a) & ((s) - 1)) == 0)
+#define ACPI_IS_POWER_OF_TWO(a)             ACPI_IS_ALIGNED(a, a)
 
 /*
  * Bitmask creation