Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/55913 )
Change subject: mb/emulation/qemu-i440fx/fw_cfg.c: Use `smbios_header` ......................................................................
mb/emulation/qemu-i440fx/fw_cfg.c: Use `smbios_header`
Replace uses of `smbios_type0` with `smbios_header` for correctness.
Change-Id: I2479984f5322f0fb474ff1707c1dd1f5885f30e9 Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/55913 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/mainboard/emulation/qemu-i440fx/fw_cfg.c 1 file changed, 9 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c index d6caedf..01be2c3 100644 --- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c +++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c @@ -393,14 +393,14 @@
static unsigned long smbios_next(unsigned long current) { - struct smbios_type0 *t0; + struct smbios_header *header; int l, count = 0; char *s;
- t0 = (void*)current; - current += t0->length; + header = (void *)current; + current += header->length; for (;;) { - s = (void*)current; + s = (void *)current; l = strlen(s); if (!l) return current + (count ? 1 : 2); @@ -424,7 +424,7 @@ unsigned long fw_cfg_smbios_tables(int *handle, unsigned long *current) { FWCfgFile f; - struct smbios_type0 *t0; + struct smbios_header *header; unsigned long start, end; int ret, i, count = 1; char *str; @@ -446,8 +446,8 @@ if (i == 16384) return 0; i += sizeof(struct smbios_type0) - 2; - t0 = (struct smbios_type0*)(*current - i); - if (t0->type != SMBIOS_BIOS_INFORMATION || t0->handle != 0) + header = (struct smbios_header *)(*current - i); + if (header->type != SMBIOS_BIOS_INFORMATION || header->handle != 0) return 0; printk(BIOS_DEBUG, "QEMU: coreboot type0 table found at 0x%lx.\n", *current - i); @@ -461,8 +461,8 @@ fw_cfg_get(f.select, (void *)start, f.size); end = start; do { - t0 = (struct smbios_type0*)end; - if (t0->type == SMBIOS_END_OF_TABLE) + header = (struct smbios_header *)end; + if (header->type == SMBIOS_END_OF_TABLE) break; end = smbios_next(end); count++;