ACPICA: actbl2: Replace 1-element arrays with flexible arrays
[platform/kernel/linux-starfive.git] / drivers / acpi / nfit / core.c
index 4e48d6d..85d9d67 100644 (file)
@@ -894,7 +894,7 @@ static size_t sizeof_flush(struct acpi_nfit_flush_address *flush)
 {
        if (flush->header.length < sizeof(*flush))
                return 0;
-       return sizeof(*flush) + sizeof(u64) * (flush->hint_count - 1);
+       return struct_size(flush, hint_address, flush->hint_count);
 }
 
 static bool add_flush(struct acpi_nfit_desc *acpi_desc,
@@ -3477,7 +3477,7 @@ static __init int nfit_init(void)
        BUILD_BUG_ON(sizeof(struct acpi_nfit_system_address) != 64);
        BUILD_BUG_ON(sizeof(struct acpi_nfit_memory_map) != 48);
        BUILD_BUG_ON(sizeof(struct acpi_nfit_interleave) != 20);
-       BUILD_BUG_ON(sizeof(struct acpi_nfit_smbios) != 9);
+       BUILD_BUG_ON(sizeof(struct acpi_nfit_smbios) != 8);
        BUILD_BUG_ON(sizeof(struct acpi_nfit_control_region) != 80);
        BUILD_BUG_ON(sizeof(struct acpi_nfit_data_region) != 40);
        BUILD_BUG_ON(sizeof(struct acpi_nfit_capabilities) != 16);