aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhi Wang <zhi.a.wang@intel.com>2016-06-16 08:06:58 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2016-06-17 14:44:25 -0400
commitb2a5d1e7162889ad28a2bd96fb556540866f599c (patch)
tree0b3c5271738c4ab1a8faf20d0e6b1e97a1916ab9
parent87da603cae438a20d4c0965794c0d3ed8c410893 (diff)
drm/i915: Use offsetof() to calculate the offset of members in PVINFO page
To get the offset of the members in PVINFO page, offsetof() looks much better than the tricky approach in current code. v7: - Move "offsetof()" modification into a dedicated patch. (Joonas) Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Zhi Wang <zhi.a.wang@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1466078825-6662-3-git-send-email-zhi.a.wang@intel.com Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/i915_pvinfo.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_pvinfo.h b/drivers/gpu/drm/i915/i915_pvinfo.h
index e61144d45a94..c0cb2974caac 100644
--- a/drivers/gpu/drm/i915/i915_pvinfo.h
+++ b/drivers/gpu/drm/i915/i915_pvinfo.h
@@ -104,7 +104,7 @@ struct vgt_if {
104} __packed; 104} __packed;
105 105
106#define vgtif_reg(x) \ 106#define vgtif_reg(x) \
107 _MMIO((VGT_PVINFO_PAGE + (long)&((struct vgt_if *)NULL)->x)) 107 _MMIO((VGT_PVINFO_PAGE + offsetof(struct vgt_if, x)))
108 108
109/* vGPU display status to be used by the host side */ 109/* vGPU display status to be used by the host side */
110#define VGT_DRV_DISPLAY_NOT_READY 0 110#define VGT_DRV_DISPLAY_NOT_READY 0