Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 27 16:15:48 UTC 2018

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915: i915_vgpu.h

Log Message:
Use offsetof, not undefined behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h:1.2 src/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h:1.3
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h:1.2	Mon Aug 27 04:58:24 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h	Mon Aug 27 16:15:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_vgpu.h,v 1.2 2018/08/27 04:58:24 riastradh Exp $	*/
+/*	$NetBSD: i915_vgpu.h,v 1.3 2018/08/27 16:15:48 riastradh Exp $	*/
 
 /*
  * Copyright(c) 2011-2015 Intel Corporation. All rights reserved.
@@ -110,7 +110,7 @@ struct vgt_if {
 } __packed;
 
 #define vgtif_reg(x) \
-	(VGT_PVINFO_PAGE + (long)&((struct vgt_if *)NULL)->x)
+	(VGT_PVINFO_PAGE + offsetof(struct vgt_if, x))
 
 /* vGPU display status to be used by the host side */
 #define VGT_DRV_DISPLAY_NOT_READY 0

Reply via email to