[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 037/106] virtio: Drop superfluous conditionals aro
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 037/106] virtio: Drop superfluous conditionals around g_strdup() |
Date: |
Wed, 18 Jun 2014 19:17:51 +0300 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
hw/net/virtio-net.c | 7 +------
hw/virtio/virtio.c | 6 +-----
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index dd28a5a..0a34a8b 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1510,13 +1510,8 @@ void virtio_net_set_netclient_name(VirtIONet *n, const
char *name,
assert(type != NULL);
g_free(n->netclient_name);
- n->netclient_name = NULL;
g_free(n->netclient_type);
- n->netclient_type = NULL;
-
- if (name != NULL) {
- n->netclient_name = g_strdup(name);
- }
+ n->netclient_name = g_strdup(name);
n->netclient_type = g_strdup(type);
}
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 3b938c8..a3082d5 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1165,11 +1165,7 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQueue
*vq)
void virtio_device_set_child_bus_name(VirtIODevice *vdev, char *bus_name)
{
g_free(vdev->bus_name);
- vdev->bus_name = NULL;
-
- if (bus_name) {
- vdev->bus_name = g_strdup(bus_name);
- }
+ vdev->bus_name = g_strdup(bus_name);
}
static void virtio_device_realize(DeviceState *dev, Error **errp)
--
MST
- [Qemu-devel] [PULL v2 040/106] migration: export SELF_ANNOUNCE_ROUNDS, (continued)
- [Qemu-devel] [PULL v2 040/106] migration: export SELF_ANNOUNCE_ROUNDS, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 078/106] vl: redo -object parsing, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 106/106] qapi/string-output-visitor: fix bugs, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 074/106] qom: introduce object_property_get_enum and object_property_get_uint16List, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 006/106] vl.c: extend -m option to support options for memory hotplug, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 020/106] acpi: memory hotplug ACPI hardware implementation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 017/106] pc-dimm: add busy address check and address auto-allocation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 008/106] qdev: expose DeviceState.hotplugged field as a property, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 048/106] vhost: add vhost_get_features and vhost_ack_features, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 076/106] memory: move mem_path handling to memory_region_allocate_system_memory, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 037/106] virtio: Drop superfluous conditionals around g_strdup(),
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 072/106] configure: add Linux libnuma detection, Michael S. Tsirkin, 2014/06/18
- Re: [Qemu-devel] [PULL v2 000/106] pc, pci, virtio, hotplug fixes, enhancements, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 032/106] pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 013/106] pc: exit QEMU if number of slots more than supported 256, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 035/106] acpi-test: update expected tables, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 062/106] NUMA: check if the total numa memory size is equal to ram_size, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 041/106] migration: introduce self_announce_delay(), Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 038/106] ich: get rid of spaces in type name, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 028/106] pc: add acpi-device link to PCMachineState, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 031/106] pc: add "hotplug-memory-region-size" property to PC_MACHINE, Michael S. Tsirkin, 2014/06/18