Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Use offsetof, not undefi...



details:   https://anonhg.NetBSD.org/src/rev/306f5461bad6
branches:  trunk
changeset: 835521:306f5461bad6
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 16:15:48 2018 +0000

description:
Use offsetof, not undefined behaviour.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 7bd3686ecdd0 -r 306f5461bad6 sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h   Mon Aug 27 16:15:34 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.h   Mon Aug 27 16:15:48 2018 +0000
@@ -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 @@
 } __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



Home | Main Index | Thread Index | Old Index