aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-16 14:50:27 +0100
committerBlue Swirl <blauwirbel@gmail.com>2013-01-19 10:22:43 +0000
commitb3dd15529de22cd4bcedb6344105e87878d971b6 (patch)
tree7eadf93d083510dc3305e6d4f85874e0c711793c
parent0e0d2d6295076815ded8d0868b7b806380df5dda (diff)
downloadqemu-arm-b3dd15529de22cd4bcedb6344105e87878d971b6.tar.gz
pc: Clean up bochs_bios_init()'s (non-)use of sizeof
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--hw/pc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/pc.c b/hw/pc.c
index bc5c33fa3e..34cf79d459 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -572,7 +572,7 @@ static void *bochs_bios_init(void)
fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
smbios_table, smbios_len);
fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE, (uint8_t *)&e820_table,
- sizeof(struct e820_table));
+ sizeof(e820_table));
fw_cfg_add_bytes(fw_cfg, FW_CFG_HPET, (uint8_t *)&hpet_cfg,
sizeof(struct hpet_fw_config));
@@ -580,7 +580,7 @@ static void *bochs_bios_init(void)
* of nodes, one word for each VCPU->node and one word for each node to
* hold the amount of memory.
*/
- numa_fw_cfg = g_malloc0((1 + max_cpus + nb_numa_nodes) * 8);
+ numa_fw_cfg = g_new0(uint64_t, 1 + max_cpus + nb_numa_nodes);
numa_fw_cfg[0] = cpu_to_le64(nb_numa_nodes);
for (i = 0; i < max_cpus; i++) {
for (j = 0; j < nb_numa_nodes; j++) {
@@ -594,7 +594,7 @@ static void *bochs_bios_init(void)
numa_fw_cfg[max_cpus + 1 + i] = cpu_to_le64(node_mem[i]);
}
fw_cfg_add_bytes(fw_cfg, FW_CFG_NUMA, (uint8_t *)numa_fw_cfg,
- (1 + max_cpus + nb_numa_nodes) * 8);
+ (1 + max_cpus + nb_numa_nodes) * sizeof(*numa_fw_cfg));
return fw_cfg;
}