From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH qom-next for-1.6 6/6] sun4m_iommu: QOM cast cleanup
Date: Fri, 26 Jul 2013 17:01:03 +0200 [thread overview]
Message-ID: <1374850864-7331-7-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1374850864-7331-1-git-send-email-afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/dma/sun4m_iommu.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/hw/dma/sun4m_iommu.c b/hw/dma/sun4m_iommu.c
index edb93f3..a04409a 100644
--- a/hw/dma/sun4m_iommu.c
+++ b/hw/dma/sun4m_iommu.c
@@ -126,8 +126,12 @@
#define IOMMU_PAGE_SIZE (1 << IOMMU_PAGE_SHIFT)
#define IOMMU_PAGE_MASK ~(IOMMU_PAGE_SIZE - 1)
+#define TYPE_SUN4M_IOMMU "iommu"
+#define SUN4M_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4M_IOMMU)
+
typedef struct IOMMUState {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
MemoryRegion iomem;
uint32_t regs[IOMMU_NREGS];
hwaddr iostart;
@@ -332,7 +336,7 @@ static const VMStateDescription vmstate_iommu = {
static void iommu_reset(DeviceState *d)
{
- IOMMUState *s = container_of(d, IOMMUState, busdev.qdev);
+ IOMMUState *s = SUN4M_IOMMU(d);
memset(s->regs, 0, IOMMU_NREGS * 4);
s->iostart = 0;
@@ -345,7 +349,7 @@ static void iommu_reset(DeviceState *d)
static int iommu_init1(SysBusDevice *dev)
{
- IOMMUState *s = FROM_SYSBUS(IOMMUState, dev);
+ IOMMUState *s = SUN4M_IOMMU(dev);
sysbus_init_irq(dev, &s->irq);
@@ -373,7 +377,7 @@ static void iommu_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo iommu_info = {
- .name = "iommu",
+ .name = TYPE_SUN4M_IOMMU,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(IOMMUState),
.class_init = iommu_class_init,
--
1.8.1.4
prev parent reply other threads:[~2013-07-26 15:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 15:00 [Qemu-devel] [PATCH qom-next for-1.6 0/6] dma: QOM cast cleanups Andreas Färber
2013-07-26 15:00 ` [Qemu-devel] [PATCH qom-next for-1.6 1/6] pl080: Rename pl080_state to PL080State Andreas Färber
2013-07-26 15:00 ` [Qemu-devel] [PATCH qom-next for-1.6 2/6] pl080: QOM'ify pl080 and pl081 Andreas Färber
2013-07-26 15:01 ` [Qemu-devel] [PATCH qom-next for-1.6 3/6] puv3_dma: QOM cast cleanup Andreas Färber
2013-07-26 15:01 ` [Qemu-devel] [PATCH qom-next for-1.6 4/6] pxa2xx_dma: " Andreas Färber
2013-07-26 15:01 ` [Qemu-devel] [PATCH qom-next for-1.6 5/6] sparc32_dma: " Andreas Färber
2013-07-26 15:01 ` Andreas Färber [this message]
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=1374850864-7331-7-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--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).