[PATCH 2/2] acpi: fadt: remove hard-coded FADT version

Alex Hung alex.hung at canonical.com
Fri Aug 13 17:02:29 UTC 2021


FADT version is the same as ACPI version, and minor is only the lower 4
bits since ACPI 6.4.

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

diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
index acf767e5..fc8b5987 100644
--- a/src/acpi/fadt/fadt.c
+++ b/src/acpi/fadt/fadt.c
@@ -196,15 +196,15 @@ static int fadt_checksum(fwts_framework *fw)
 
 static int fadt_revision(fwts_framework *fw)
 {
-	const uint8_t LATEST_MAJOR = 6;
-	const uint8_t LATEST_MINOR = 3;
+	const uint8_t LATEST_MAJOR = (FWTS_ACPI_VERSION_NOW & 0xF00) >> 8;
+	const uint8_t LATEST_MINOR = (FWTS_ACPI_VERSION_NOW & 0xFF) >> 4;
 	uint8_t major;
 	uint8_t minor;
 
 	major = fadt->header.revision;
 	minor = 0;
 	if (major >= 5 && fadt->header.length >= 268)
-		minor = fadt->minor_version;   /* field added ACPI 5.1 */
+		minor = fadt->minor_version & 0xF;   /* field added ACPI 5.1 */
 
 	fwts_log_info(fw, "FADT revision: %" PRIu8 ".%" PRIu8, major, minor);
 	fwts_log_info(fw, "FADT table length: %" PRIu32, fadt->header.length);
-- 
2.32.0




More information about the fwts-devel mailing list