public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] DRM: don't cast a pointer to pointer of list_head
@ 2007-12-06  9:35 Li Zefan
  0 siblings, 0 replies; only message in thread
From: Li Zefan @ 2007-12-06  9:35 UTC (permalink / raw)
  To: airlied; +Cc: dri-devel, LKML, Andrew Morton


The casting is safe only when the list_head member is the
first member of the structure.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

---
 drivers/char/drm/i915_irq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c
index a443f4a..e9e8522 100644
--- a/drivers/char/drm/i915_irq.c
+++ b/drivers/char/drm/i915_irq.c
@@ -555,7 +555,7 @@ int i915_vblank_swap(struct drm_device *dev, void *data,
 
 	spin_lock_irqsave(&dev_priv->swaps_lock, irqflags);
 
-	list_add_tail((struct list_head *)vbl_swap, &dev_priv->vbl_swaps.head);
+	list_add_tail(&vbl_swap->head, &dev_priv->vbl_swaps.head);
 	dev_priv->swaps_pending++;
 
 	spin_unlock_irqrestore(&dev_priv->swaps_lock, irqflags);
-- 
1.5.3.rc7


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-06  9:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-06  9:35 [PATCH 2/3] DRM: don't cast a pointer to pointer of list_head Li Zefan

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