diff options
author | Lv Zheng <lv.zheng@intel.com> | 2016-05-05 07:58:45 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-05-05 16:22:27 +0300 |
commit | 9222aa8234d9f07a70e815ddd3b44a97d673aff5 (patch) | |
tree | b0b8f78a412d8023d28b4f81319894a6aa0d7cb0 /drivers/acpi/acpica/exfldio.c | |
parent | b314a172ee968d45f72dffea68ab8af38aa80ded (diff) | |
download | linux-9222aa8234d9f07a70e815ddd3b44a97d673aff5.tar.xz |
ACPICA: Executer: Introduce a set of macros to handle bit width mask generation
ACPICA commit c23034a3a09d5ed79f1827d51f43cfbccf68ab64
A regression was reported to the shift offset >= width of type.
This patch fixes this issue. BZ 1270.
This is a part of the fix because the order of the patches are modified for
Linux upstream, containing the cleanups for the old code. Lv Zheng.
Link: https://github.com/acpica/acpica/commit/c23034a3
Link: https://bugs.acpica.org/show_bug.cgi?id=1270
Reported-by: Sascha Wildner <swildner@gmail.com>
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/exfldio.c')
-rw-r--r-- | drivers/acpi/acpica/exfldio.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index 72f917618578..ee76d299b3d0 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c @@ -897,17 +897,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, access_bit_width = ACPI_MUL_8(obj_desc->common_field.access_byte_width); - /* - * Create the bitmasks used for bit insertion. - * Note: This if/else is used to bypass compiler differences with the - * shift operator - */ - if (access_bit_width == ACPI_INTEGER_BIT_SIZE) { - width_mask = ACPI_UINT64_MAX; - } else { - width_mask = ACPI_MASK_BITS_ABOVE(access_bit_width); - } + /* Create the bitmasks used for bit insertion */ + width_mask = ACPI_MASK_BITS_ABOVE_64(access_bit_width); mask = width_mask & ACPI_MASK_BITS_BELOW(obj_desc->common_field.start_field_bit_offset); |