@@ -187,7 +187,7 @@ static int hmat_test1(fwts_framework *fw)
type_length = sizeof(fwts_acpi_table_hmat_cache) +
((fwts_acpi_table_hmat_cache *) entry)->num_smbios * 2;
} else {
- fwts_acpi_reserved_type(fw, "HMAT", entry->type, 0, FWTS_HMAT_TYPE_RESERVED - 1, &passed);
+ fwts_acpi_reserved_type(fw, "HMAT", entry->type, 0, FWTS_HMAT_TYPE_RESERVED, &passed);
break;
}
@@ -503,7 +503,7 @@ static int nfit_test1(fwts_framework *fw)
reserved_passed = nfit_struct->reserved2;
} else {
- fwts_acpi_reserved_type(fw, "NFIT", entry->type, 0, FWTS_NFIT_TYPE_RESERVED - 1, &passed);
+ fwts_acpi_reserved_type(fw, "NFIT", entry->type, 0, FWTS_NFIT_TYPE_RESERVED, &passed);
break;
}
@@ -145,7 +145,7 @@ static int phat_test1(fwts_framework *fw)
} else if (entry->type == FWTS_PHAT_HEALTH) {
phat_health_test(fw, (fwts_acpi_table_phat_health *) entry, offset, &passed);
} else {
- fwts_acpi_reserved_type(fw, "PHAT", entry->type, 0, FWTS_PHAT_RESERVED - 1, &passed);
+ fwts_acpi_reserved_type(fw, "PHAT", entry->type, 0, FWTS_PHAT_RESERVED, &passed);
break;
}
@@ -153,7 +153,7 @@ static int pptt_test1(fwts_framework *fw)
pptt_id_test(fw, (fwts_acpi_table_pptt_id *) entry, &passed);
type_length = sizeof(fwts_acpi_table_pptt_id);
} else {
- fwts_acpi_reserved_type(fw, "PPTT", entry->type, 0, FWTS_PPTT_RESERVED - 1, &passed);
+ fwts_acpi_reserved_type(fw, "PPTT", entry->type, 0, FWTS_PPTT_RESERVED, &passed);
break;
}
@@ -1601,7 +1601,7 @@ void fwts_acpi_reserved_type(
fwts_failed(fw, LOG_LEVEL_HIGH, label,
"%4.4s must have subtable with Type %" PRId8
"..%" PRId8 ", got %" PRId8 " instead",
- table, min, reserved, value);
+ table, min, reserved - 1, value);
*passed = false;
}
BugLink: https://bugs.launchpad.net/fwts/+bug/2000752 The function fwts_acpi_reserved_type verify the type to see if in reserved, which compares with the value with >= if (value < min || value >= reserved) { So it shouldn't pass the reserved value with RESERVED - 1. Also modify the print out maximum value for reserved. Signed-off-by: Ivan Hu <ivan.hu@canonical.com> --- src/acpi/hmat/hmat.c | 2 +- src/acpi/nfit/nfit.c | 2 +- src/acpi/phat/phat.c | 2 +- src/acpi/pptt/pptt.c | 2 +- src/lib/src/fwts_acpi_tables.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)