From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTO9-0002Jh-Vb for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:50:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvTO4-0007LW-83 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:50:45 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:41551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTO4-0007LB-0k for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:50:40 -0500 From: Markus Armbruster Date: Wed, 16 Jan 2013 14:50:27 +0100 Message-Id: <1358344229-18006-7-git-send-email-armbru@redhat.com> In-Reply-To: <1358344229-18006-1-git-send-email-armbru@redhat.com> References: <1358344229-18006-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 6/8] pc: Clean up bochs_bios_init()'s (non-)use of sizeof List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, aliguori@us.ibm.com, gleb@redhat.com Signed-off-by: Markus Armbruster --- hw/pc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index bc5c33f..34cf79d 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; } -- 1.7.11.7