aboutsummaryrefslogtreecommitdiff
path: root/hw/xtensa
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-06-29 14:54:49 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2023-07-08 07:24:38 +0300
commitb697a48924fc1b6ea3b6077f824a2753cfa1b210 (patch)
treee25b5f4b27a9198fca74c2339b1295a660b3dac6 /hw/xtensa
parentc35d9373be7b60a442b9bbb6cfd2ad5f5bde581d (diff)
downloadqemu-b697a48924fc1b6ea3b6077f824a2753cfa1b210.zip
qemu-b697a48924fc1b6ea3b6077f824a2753cfa1b210.tar.gz
qemu-b697a48924fc1b6ea3b6077f824a2753cfa1b210.tar.bz2
hw: Simplify calls to pci_nic_init_nofail()
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 <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/xtensa')
-rw-r--r--hw/xtensa/virt.c8
1 files changed, 1 insertions, 7 deletions
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);
}
}
}