efi: Replace zero-length array and use struct_size() helper
[linux-2.6-microblaze.git] / drivers / firmware / efi / efi.c
index 7f1657b..edc5d36 100644 (file)
@@ -622,7 +622,8 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables,
                        rsv = (void *)(p + prsv % PAGE_SIZE);
 
                        /* reserve the entry itself */
-                       memblock_reserve(prsv, EFI_MEMRESERVE_SIZE(rsv->size));
+                       memblock_reserve(prsv,
+                                        struct_size(rsv, entry, rsv->size));
 
                        for (i = 0; i < atomic_read(&rsv->count); i++) {
                                memblock_reserve(rsv->entry[i].base,