From b697a48924fc1b6ea3b6077f824a2753cfa1b210 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 29 Jun 2023 14:54:49 +0200 Subject: hw: Simplify calls to pci_nic_init_nofail() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pci_nic_init_nofail() calls qemu_find_nic_model(), and this function sets nd->model = g_strdup(default_model) if it has not been initialized yet. So we don't have to set nd->model to the default_nic in the calling sites. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- hw/xtensa/virt.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'hw/xtensa') diff --git a/hw/xtensa/virt.c b/hw/xtensa/virt.c index b87f842..a6cf646 100644 --- a/hw/xtensa/virt.c +++ b/hw/xtensa/virt.c @@ -103,13 +103,7 @@ static void create_pcie(MachineState *ms, CPUXtensaState *env, int irq_base, pci = PCI_HOST_BRIDGE(dev); if (pci->bus) { for (i = 0; i < nb_nics; i++) { - NICInfo *nd = &nd_table[i]; - - if (!nd->model) { - nd->model = g_strdup(mc->default_nic); - } - - pci_nic_init_nofail(nd, pci->bus, nd->model, NULL); + pci_nic_init_nofail(&nd_table[i], pci->bus, mc->default_nic, NULL); } } } -- cgit v1.1