From: Andrew Cooper Subject: [PATCH 13/32] smbios: Don't allocate smbus eeprom buffer Date: Wed, 22 Apr 2015 16:07:50 +0100 Message-ID: <1429715289-4954-13-git-send-email-andrew.cooper3@citrix.com> References: <1429715235-4759-1-git-send-email-andrew.cooper3@citrix.com> <1429715289-4954-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429715289-4954-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel List-Id: xen-devel@lists.xenproject.org smbus_eeprom_device_init() has been disabled since 2007. The #define turns the actual function call into a comma expression with no effect. Removing the leaked allocation also makes Valgrind happier. Signed-off-by: Andrew Cooper Coverity-ID: 1090387 --- hw/pc.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 3e33694..7359338 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -79,7 +79,6 @@ static void xen_relocator_hook(target_phys_addr_t *prot_addr_upd, uint16_t protocol, const uint8_t header[], int kernel_size, target_phys_addr_t real_addr, int real_size); -#define smbus_eeprom_device_init (void) static void ioport80_write(void *opaque, uint32_t addr, uint32_t data) { @@ -1135,17 +1134,8 @@ vga_bios_error: } if (pci_enabled && acpi_enabled) { - uint8_t *eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */ - i2c_bus *smbus; - /* TODO: Populate SPD eeprom data. */ - smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]); - - if (smbus) { - for (i = 0; i < 8; i++) { - smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256)); - } - } + piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]); } if (i440fx_state) { -- 1.7.10.4