diff options
author | Lv Zheng <lv.zheng@intel.com> | 2016-03-24 09:41:02 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-04-05 03:53:33 +0200 |
commit | 0461f34e16b39b083f289d27d2355df9d5ba1420 (patch) | |
tree | 9968d659849088735bb80698fc748301ce18d167 /drivers/acpi/acpica/acmacros.h | |
parent | a8d1e1c063b0b1c91a9415f5cb09e37a75bce809 (diff) |
Utilities: Fix missing parentheses in ACPI_GET_BITS()/ACPI_SET_BITS()
Some compilers require parentheses to be enforced in the macro definition,
so that the macro caller side can be simpler.
This patch fixes this kind of macro issue in
ACPI_SET_BITS()/ACPI_GET_BITS(). Lv Zheng.
Link: https://bugs.acpica.org/show_bug.cgi?id=1268
Signed-off-by: Lv Zheng <lv.zheng@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.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h index b461f5568e8c..73f6653c848d 100644 --- a/drivers/acpi/acpica/acmacros.h +++ b/drivers/acpi/acpica/acmacros.h @@ -287,10 +287,10 @@ /* Generic bitfield macros and masks */ #define ACPI_GET_BITS(source_ptr, position, mask) \ - ((*source_ptr >> position) & mask) + ((*(source_ptr) >> (position)) & (mask)) #define ACPI_SET_BITS(target_ptr, position, mask, value) \ - (*target_ptr |= ((value & mask) << position)) + (*(target_ptr) |= (((value) & (mask)) << (position))) #define ACPI_1BIT_MASK 0x00000001 #define ACPI_2BIT_MASK 0x00000003 |