diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-21 03:50:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-21 03:50:39 -0400 |
commit | e04997b13a2c2fc93af970fe95fd29a74db113e8 (patch) | |
tree | a84ec3368edc3c2568a0d6acdfa0d0e50d8cacf7 /drivers/acpi/acpica/exprep.c | |
parent | 6651ffc8e8bdd5fb4b7d1867c6cfebb4f309512c (diff) | |
parent | 05ce7bfe547c9fa967d9cab6c37867a9cb6fb3fa (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'drivers/acpi/acpica/exprep.c')
-rw-r--r-- | drivers/acpi/acpica/exprep.c | 17 |
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) | |||
471 | /* allow full data read from EC address space */ | 471 | /* allow full data read from EC address space */ |
472 | if (obj_desc->field.region_obj->region.space_id == | 472 | if (obj_desc->field.region_obj->region.space_id == |
473 | ACPI_ADR_SPACE_EC) { | 473 | ACPI_ADR_SPACE_EC) { |
474 | if (obj_desc->common_field.bit_length > 8) | 474 | if (obj_desc->common_field.bit_length > 8) { |
475 | obj_desc->common_field.access_bit_width = | 475 | unsigned width = |
476 | ACPI_ROUND_UP(obj_desc->common_field. | 476 | ACPI_ROUND_BITS_UP_TO_BYTES( |
477 | bit_length, 8); | 477 | obj_desc->common_field.bit_length); |
478 | // access_bit_width is u8, don't overflow it | ||
479 | if (width > 8) | ||
480 | width = 8; | ||
478 | obj_desc->common_field.access_byte_width = | 481 | obj_desc->common_field.access_byte_width = |
479 | ACPI_DIV_8(obj_desc->common_field. | 482 | width; |
480 | access_bit_width); | 483 | obj_desc->common_field.access_bit_width = |
484 | 8 * width; | ||
485 | } | ||
481 | } | 486 | } |
482 | 487 | ||
483 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 488 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |