qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: jsnow@redhat.com
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Li Qiang <liq3ea@gmail.com>
Subject: [Qemu-devel] [PATCH] ide: piix: convert constant device name to MACRO
Date: Tue,  9 Oct 2018 21:29:24 -0700	[thread overview]
Message-ID: <1539145764-5730-1-git-send-email-liq3ea@gmail.com> (raw)

Signed-off-by: Li Qiang <liq3ea@gmail.com>
---
 hw/ide/piix.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index a3afe1f..5f29cce 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -35,6 +35,10 @@
 #include "hw/ide/pci.h"
 #include "trace.h"
 
+#define TYPE_PIIX3_IDE "piix3-ide"
+#define TYPE_PIIX3_IDE_XEN "piix3-ide-xen"
+#define TYPE_PIIX4_IDE "piix4-ide"
+
 static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size)
 {
     BMDMAState *bm = opaque;
@@ -204,7 +208,7 @@ PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
 {
     PCIDevice *dev;
 
-    dev = pci_create_simple(bus, devfn, "piix3-ide-xen");
+    dev = pci_create_simple(bus, devfn, TYPE_PIIX3_IDE_XEN);
     pci_ide_create_devs(dev, hd_table);
     return dev;
 }
@@ -226,7 +230,7 @@ PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
 {
     PCIDevice *dev;
 
-    dev = pci_create_simple(bus, devfn, "piix3-ide");
+    dev = pci_create_simple(bus, devfn, TYPE_PIIX3_IDE);
     pci_ide_create_devs(dev, hd_table);
     return dev;
 }
@@ -237,7 +241,7 @@ PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
 {
     PCIDevice *dev;
 
-    dev = pci_create_simple(bus, devfn, "piix4-ide");
+    dev = pci_create_simple(bus, devfn, TYPE_PIIX4_IDE);
     pci_ide_create_devs(dev, hd_table);
     return dev;
 }
@@ -257,13 +261,13 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo piix3_ide_info = {
-    .name          = "piix3-ide",
+    .name          = TYPE_PIIX3_IDE,
     .parent        = TYPE_PCI_IDE,
     .class_init    = piix3_ide_class_init,
 };
 
 static const TypeInfo piix3_ide_xen_info = {
-    .name          = "piix3-ide-xen",
+    .name          = TYPE_PIIX3_IDE_XEN,
     .parent        = TYPE_PCI_IDE,
     .class_init    = piix3_ide_class_init,
 };
@@ -283,7 +287,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo piix4_ide_info = {
-    .name          = "piix4-ide",
+    .name          = TYPE_PIIX4_IDE,
     .parent        = TYPE_PCI_IDE,
     .class_init    = piix4_ide_class_init,
 };
-- 
1.8.3.1

             reply	other threads:[~2018-10-10  4:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10  4:29 Li Qiang [this message]
2018-10-10 16:40 ` [Qemu-devel] [PATCH] ide: piix: convert constant device name to MACRO John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1539145764-5730-1-git-send-email-liq3ea@gmail.com \
    --to=liq3ea@gmail.com \
    --cc=jsnow@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).