projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87da603
)
drm/i915: Use offsetof() to calculate the offset of members in PVINFO page
author
Zhi Wang
<
[email protected]
>
Thu, 16 Jun 2016 12:06:58 +0000
(08:06 -0400)
committer
Chris Wilson
<
[email protected]
>
Fri, 17 Jun 2016 18:44:25 +0000
(19:44 +0100)
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 <
[email protected]
>
Reviewed-by: Joonas Lahtinen <
[email protected]
>
Cc: Joonas Lahtinen <
[email protected]
>
Signed-off-by: Zhi Wang <
[email protected]
>
Link:
http://patchwork.freedesktop.org/patch/msgid/
[email protected]
Signed-off-by: Chris Wilson <
[email protected]
>
drivers/gpu/drm/i915/i915_pvinfo.h
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/i915/i915_pvinfo.h
b/drivers/gpu/drm/i915/i915_pvinfo.h
index e61144d45a94c6b0217892149de8bd3e2c67850c..c0cb2974caacdb0357b8fcde1a585da51ead7b43 100644
(file)
--- a/
drivers/gpu/drm/i915/i915_pvinfo.h
+++ b/
drivers/gpu/drm/i915/i915_pvinfo.h
@@
-104,7
+104,7
@@
struct vgt_if {
} __packed;
#define vgtif_reg(x) \
- _MMIO((VGT_PVINFO_PAGE +
(long)&((struct vgt_if *)NULL)->x
))
+ _MMIO((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