summaryrefslogtreecommitdiff
path: root/kvm_coalesced_mmio.c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2011-06-08 12:49:42 -0700
committerRobert Mustacchi <rm@joyent.com>2011-06-08 12:49:42 -0700
commitfc81a7032577914bac149316323d225e6c268a18 (patch)
treeb653340be716504ab3551a85a00377c20c6b1c74 /kvm_coalesced_mmio.c
parentce88b2d2a6af27fd7873e2ff5c41c0ac387cddbe (diff)
downloadillumos-kvm-fc81a7032577914bac149316323d225e6c268a18.tar.gz
HVM-328 replace container_of with offsetof calculations
Diffstat (limited to 'kvm_coalesced_mmio.c')
-rw-r--r--kvm_coalesced_mmio.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kvm_coalesced_mmio.c b/kvm_coalesced_mmio.c
index 2b4fc52..7c097e3 100644
--- a/kvm_coalesced_mmio.c
+++ b/kvm_coalesced_mmio.c
@@ -15,12 +15,9 @@
static struct kvm_coalesced_mmio_dev *
to_mmio(struct kvm_io_device *dev)
{
-#ifdef XXX
- return (container_of(dev, struct kvm_coalesced_mmio_dev, dev));
-#else
- XXX_KVM_PROBE;
- return ((struct kvm_coalesced_mmio_dev *)dev);
-#endif
+ uintptr_t dp = (uintptr_t)dev;
+ return ((struct kvm_coalesced_mmio_dev *)(dp -
+ offsetof(struct kvm_coalesced_mmio_dev, dev)));
}
static int