Skip to content

Commit

Permalink
Utilities: Fix missing parentheses in ACPI_GET_BITS()/ACPI_SET_BITS()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Apr 5, 2016
1 parent a8d1e1c commit 0461f34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/acmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0461f34

Please sign in to comment.