Skip to content

Commit

Permalink
Hardware: Fix a regression introduced in AcpiHwRead()/AcpiHwWrite()
Browse files Browse the repository at this point in the history
The regression was introduced by the following commit:
  Commit: 3d8583a
  Subject: Hardware: Fix 2 issues in AccessWidth support
Which messed BitWidth with a rounded up value. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
  • Loading branch information
Lv Zheng committed Mar 23, 2016
1 parent e714615 commit 41f6aef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/components/hardware/hwregs.c
Expand Up @@ -272,7 +272,7 @@ AcpiHwRead (
*Value = 0;
AccessWidth = Reg->AccessWidth ? Reg->AccessWidth : 1;
AccessWidth = 1 << (AccessWidth + 2);
BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth);
BitWidth = Reg->BitOffset + Reg->BitWidth;
BitOffset = Reg->BitOffset;

/*
Expand Down Expand Up @@ -375,7 +375,7 @@ AcpiHwWrite (

AccessWidth = Reg->AccessWidth ? Reg->AccessWidth : 1;
AccessWidth = 1 << (AccessWidth + 2);
BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth);
BitWidth = Reg->BitOffset + Reg->BitWidth;
BitOffset = Reg->BitOffset;

/*
Expand Down

0 comments on commit 41f6aef

Please sign in to comment.