Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Assert intel_wait and its rb_node are complimentary
@ 2018-10-12 15:15 Chris Wilson
  2018-10-12 15:55 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2018-10-12 15:15 UTC (permalink / raw)
  To: intel-gfx

For convenience, we want to interchange intel_wait/rb_node and treat a
NULL rb_node as a NULL intel_wait and vice versa. Assert that the
rb_node is at offset 0 in the intel_wait to ensure this.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
index 84bf8d827136..44f117612193 100644
--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
@@ -342,6 +342,7 @@ static bool __intel_breadcrumbs_enable_irq(struct intel_breadcrumbs *b)
 
 static inline struct intel_wait *to_wait(struct rb_node *node)
 {
+	BUILD_BUG_ON(offsetof(struct intel_wait, node));
 	return rb_entry(node, struct intel_wait, node);
 }
 
-- 
2.19.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-15 13:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-12 15:15 [PATCH] drm/i915: Assert intel_wait and its rb_node are complimentary Chris Wilson
2018-10-12 15:55 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-10-12 19:06 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-15 12:58 ` [PATCH] " Tvrtko Ursulin
2018-10-15 13:04   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox