summaryrefslogtreecommitdiff
path: root/kvm_vmx.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_vmx.c
parentce88b2d2a6af27fd7873e2ff5c41c0ac387cddbe (diff)
downloadillumos-kvm-fc81a7032577914bac149316323d225e6c268a18.tar.gz
HVM-328 replace container_of with offsetof calculations
Diffstat (limited to 'kvm_vmx.c')
-rw-r--r--kvm_vmx.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/kvm_vmx.c b/kvm_vmx.c
index c66ec7a..c999041 100644
--- a/kvm_vmx.c
+++ b/kvm_vmx.c
@@ -178,13 +178,8 @@ typedef struct vcpu_vmx {
static struct vcpu_vmx *
to_vmx(struct kvm_vcpu *vcpu)
{
-#ifdef XXX_KVM_DOESNTCOMPILE
- return (container_of(vcpu, struct vcpu_vmx, vcpu));
-#else
- /* assumes vcpu is first field in vcpu_vmx */
- /* because gcc with kernel flags complains about container_of */
- return ((struct vcpu_vmx *)vcpu);
-#endif
+ return ((struct vcpu_vmx *)((uintptr_t)vcpu -
+ offsetof(struct vcpu_vmx, vcpu)));
}
typedef struct vmcs_config {