Skip to contentSkip to conversation

hw/s390x/s390-virtio-ccw: Remove superfluous code to set the NIC model

PATCH Applied Thomas Huth 4 participants 4 messages Aug 4, 2023 – Aug 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/s390x/s390-virtio-ccw: Remove superfluous code to set the NIC model

The check for nd->model being NULL was originally required, but in commit e11f463295d95aba ("s390x/virtio: use qemu_check_nic_model()") the corresponding code had been replaced by a call to the function qemu_check_nic_model() - and this in turn calls qemu_find_nic_model() which contains the same check for nd->model being NULL again. So we can remove this from the calling site now.

---
 hw/s390x/s390-virtio-ccw.c | 4 ----
 1 file changed, 4 deletions(-)
hw/s390x/s390-virtio-ccw.c +0 -4
index 4516d73ff5..b83187effb 100644
@@ -222,10 +222,6 @@ static void s390_create_virtio_net(BusState *bus, const char *name)
         NICInfo *nd = &nd_table[i];
         DeviceState *dev;
 
-        if (!nd->model) {
-            nd->model = g_strdup("virtio");
-        }
-
         qemu_check_nic_model(nd, "virtio");
 
         dev = qdev_new(name);
Signature · 1 line
2.39.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Thomas Huth

The check for nd->model being NULL was originally required, but in commit e11f463295d95aba ("s390x/virtio: use qemu_check_nic_model()") the corresponding code had been replaced by a call to the function qemu_check_nic_model() - and this in turn calls qemu_find_nic_model() which contains the same check for nd->model being NULL again. So we can remove this from the calling site now.

---
 hw/s390x/s390-virtio-ccw.c | 4 ----
 1 file changed, 4 deletions(-)
#2 lore raw
In reply to Thomas Huth

04.08.2023 10:35, Thomas Huth пишет:

Quoted 6 lines

The check for nd->model being NULL was originally required, but in commit e11f463295d95aba ("s390x/virtio: use qemu_check_nic_model()") the corresponding code had been replaced by a call to the function qemu_check_nic_model() - and this in turn calls qemu_find_nic_model() which contains the same check for nd->model being NULL again. So we can remove this from the calling site now.

Applied to my trivial-patches tree, thanks!

/mjt

Reviewed-by on v1 1/1
#3 lore raw
In reply to Thomas Huth
Quoted 8 lines · On Fri, 4 Aug 2023 09:35:25 +0200 Thomas Huth <[email protected]> wrote:

The check for nd->model being NULL was originally required, but in commit e11f463295d95aba ("s390x/virtio: use qemu_check_nic_model()") the corresponding code had been replaced by a call to the function qemu_check_nic_model() - and this in turn calls qemu_find_nic_model() which contains the same check for nd->model being NULL again. So we can remove this from the calling site now.