qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 06/25] s390x/css: use define for "virtual-css-bridge"


From: Cornelia Huck
Subject: [Qemu-devel] [PULL 06/25] s390x/css: use define for "virtual-css-bridge" literal
Date: Mon, 11 Jul 2016 10:08:53 +0200

From: Sascha Silbe <address@hidden>

Introduce a TYPE_* define (like we already use for a couple of other
QOM types) for the name of the virtual CSS bridge QOM type instead of
sprinkling the same string literal over several source files.

Signed-off-by: Sascha Silbe <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
 hw/s390x/s390-virtio-ccw.c | 2 +-
 hw/s390x/virtio-ccw.c      | 4 ++--
 hw/s390x/virtio-ccw.h      | 3 +++
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 52f079a..3b79e96 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -29,7 +29,7 @@
 #include "hw/s390x/s390-virtio-ccw.h"
 
 static const char *const reset_dev_types[] = {
-    "virtual-css-bridge",
+    TYPE_VIRTUAL_CSS_BRIDGE,
     "s390-sclp-event-facility",
     "s390-flic",
     "diag288",
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 67d7867..0afc0d3 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -130,7 +130,7 @@ VirtualCssBus *virtual_css_bus_init(void)
     DeviceState *dev;
 
     /* Create bridge device */
-    dev = qdev_create(NULL, "virtual-css-bridge");
+    dev = qdev_create(NULL, TYPE_VIRTUAL_CSS_BRIDGE);
     qdev_init_nofail(dev);
 
     /* Create bus on bridge device */
@@ -1626,7 +1626,7 @@ static void virtual_css_bridge_class_init(ObjectClass 
*klass, void *data)
 }
 
 static const TypeInfo virtual_css_bridge_info = {
-    .name          = "virtual-css-bridge",
+    .name          = TYPE_VIRTUAL_CSS_BRIDGE,
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(SysBusDevice),
     .class_init    = virtual_css_bridge_class_init,
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index 7243fb0..6144625 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -101,6 +101,9 @@ static inline int virtio_ccw_rev_max(VirtioCcwDevice *dev)
     return dev->max_rev;
 }
 
+/* virtual css bridge type */
+#define TYPE_VIRTUAL_CSS_BRIDGE "virtual-css-bridge"
+
 /* virtual css bus type */
 typedef struct VirtualCssBus {
     BusState parent_obj;
-- 
2.9.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]