summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2010-04-16 22:08:07 +0200
committerLen Brown <len.brown@intel.com>2010-04-16 22:08:07 +0200
commitbc3966921ff9528ae44a4a108085ab06107c1e7d (patch)
tree4bcc60e2b560a1faa636b1f4588b2e673b6a2268 /drivers/acpi
parentMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kern... (diff)
parentACPI: EC: Limit burst to 64 bits (diff)
downloadlinux-bc3966921ff9528ae44a4a108085ab06107c1e7d.tar.xz
linux-bc3966921ff9528ae44a4a108085ab06107c1e7d.zip
Merge branch 'bugzilla-15749' into release
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpica/exprep.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
index a610ebe18edd..2fbfe51fb141 100644
--- a/drivers/acpi/acpica/exprep.c
+++ b/drivers/acpi/acpica/exprep.c
@@ -471,13 +471,18 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
/* allow full data read from EC address space */
if (obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_EC) {
- if (obj_desc->common_field.bit_length > 8)
- obj_desc->common_field.access_bit_width =
- ACPI_ROUND_UP(obj_desc->common_field.
- bit_length, 8);
+ if (obj_desc->common_field.bit_length > 8) {
+ unsigned width =
+ ACPI_ROUND_BITS_UP_TO_BYTES(
+ obj_desc->common_field.bit_length);
+ // access_bit_width is u8, don't overflow it
+ if (width > 8)
+ width = 8;
obj_desc->common_field.access_byte_width =
- ACPI_DIV_8(obj_desc->common_field.
- access_bit_width);
+ width;
+ obj_desc->common_field.access_bit_width =
+ 8 * width;
+ }
}
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,