diff options
author | Robert Mustacchi <rm@joyent.com> | 2011-06-08 12:49:42 -0700 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2011-06-08 12:49:42 -0700 |
commit | fc81a7032577914bac149316323d225e6c268a18 (patch) | |
tree | b653340be716504ab3551a85a00377c20c6b1c74 /kvm_vmx.c | |
parent | ce88b2d2a6af27fd7873e2ff5c41c0ac387cddbe (diff) | |
download | illumos-kvm-fc81a7032577914bac149316323d225e6c268a18.tar.gz |
HVM-328 replace container_of with offsetof calculations
Diffstat (limited to 'kvm_vmx.c')
-rw-r--r-- | kvm_vmx.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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 { |