[PATCH] acpi: dbg2: fix incorrect address size check with GAS struct

Alex Hung alex.hung at canonical.com
Wed Mar 30 09:52:51 UTC 2016


DBG2 spec defines AddressSize[] to be "Array of address sizes
corresponding to each generic address above", and this should
be the size pointed by GAS's address field

Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/acpi/dbg2/dbg2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/acpi/dbg2/dbg2.c b/src/acpi/dbg2/dbg2.c
index 610e32c..e19b372 100644
--- a/src/acpi/dbg2/dbg2.c
+++ b/src/acpi/dbg2/dbg2.c
@@ -358,12 +358,11 @@ static int dbg2_test1(fwts_framework *fw)
 				fwts_log_info_verbatum(fw, "    Address                 0x%16.16" PRIx64, gas->address);
 				fwts_log_nl(fw);
 
-				if (*addrsize != sizeof(fwts_acpi_gas)) {
+				if (*addrsize == 0) {
 					passed = false;
 					fwts_failed(fw, LOG_LEVEL_HIGH,
 						"DBG2InvalidAddressSize",
-						"DBG2 Address Size is not the size of a "
-						"Generic Address Structure");
+						"DBG2 Address Size is 0");
 				}
 
 				if (gas->register_bit_width == 0) {
-- 
2.5.0




More information about the fwts-devel mailing list