Skip to contentSkip to conversation

hw: edu: replace device name with macro

PATCH Applied Li Qiang 2 participants 2 messages Sep 14, 2018

lore
Share & tools
lore

Li Qiang

author
#0 lore raw

PATCH 1/1 hw: edu: replace device name with macro

Just as other devices do.

---
 hw/misc/edu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/misc/edu.c +3 -2
index df26a4d046..0687ffd343 100644
@@ -30,7 +30,8 @@
 #include "qemu/main-loop.h" /* iothread mutex */
 #include "qapi/visitor.h"
 
-#define EDU(obj)        OBJECT_CHECK(EduState, obj, "edu")
+#define TYPE_PCI_EDU_DEVICE "edu"
+#define EDU(obj)        OBJECT_CHECK(EduState, obj, TYPE_PCI_EDU_DEVICE)
 
 #define FACT_IRQ        0x00000001
 #define DMA_IRQ         0x00000100
@@ -414,7 +415,7 @@ static void pci_edu_register_types(void)
         { },
     };
     static const TypeInfo edu_info = {
-        .name          = "edu",
+        .name          = TYPE_PCI_EDU_DEVICE,
         .parent        = TYPE_PCI_DEVICE,
         .instance_size = sizeof(EduState),
         .instance_init = edu_instance_init,
Signature · 1 line
2.11.0
#1 lore raw
Quoted 23 lines · Li Qiang

Just as other devices do.

---
 hw/misc/edu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/misc/edu.c +2 -1
index df26a4d046..0687ffd343 100644
@@ -30,7 +30,8 @@
 #include "qemu/main-loop.h" /* iothread mutex */
 #include "qapi/visitor.h"
 
-#define EDU(obj)        OBJECT_CHECK(EduState, obj, "edu")
+#define TYPE_PCI_EDU_DEVICE "edu"
+#define EDU(obj)        OBJECT_CHECK(EduState, obj, TYPE_PCI_EDU_DEVICE)
 
 #define FACT_IRQ        0x00000001
 #define DMA_IRQ         0x00000100

hw/misc/edu.c static void pci_edu_register_types(void) · line 421

Quoted 8 lines
hw/misc/edu.c +1 -1
@@ -414,7 +415,7 @@ static void pci_edu_register_types(void)
         { },
     };
     static const TypeInfo edu_info = {
-        .name          = "edu",
+        .name          = TYPE_PCI_EDU_DEVICE,
         .parent        = TYPE_PCI_DEVICE,
         .instance_size = sizeof(EduState),
         .instance_init = edu_instance_init,

Queued, thanks.

Paolo