mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ACPICA / hardware: Fix address check in acpi_hw_get_access_bit_width()
@ 2016-05-27  3:40 Lv Zheng
  2016-05-27  3:53 ` Zheng, Lv
  0 siblings, 1 reply; 2+ messages in thread
From: Lv Zheng @ 2016-05-27  3:40 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi

The address check in acpi_hw_get_access_bit_width() should be byte size
based, not bit width based. This patch fixes this mistake.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/hwregs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 0f18dbc..74a591b 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -95,7 +95,7 @@ acpi_hw_get_access_bit_width(struct acpi_generic_address *reg, u8 max_bit_width)
 		if (!reg->bit_offset && reg->bit_width &&
 		    ACPI_IS_POWER_OF_TWO(reg->bit_width) &&
 		    ACPI_IS_ALIGNED(reg->bit_width, 8) &&
-		    ACPI_IS_ALIGNED(address, reg->bit_width)) {
+		    ACPI_IS_ALIGNED(address, reg->bit_width >> 3)) {
 			return (reg->bit_width);
 		} else {
 			if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
-- 
1.7.10

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-27  3:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-27  3:40 [PATCH] ACPICA / hardware: Fix address check in acpi_hw_get_access_bit_width() Lv Zheng
2016-05-27  3:53 ` Zheng, Lv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®