Skip to contentSkip to conversation

DRM: don't cast a pointer to pointer of list_head

PATCH In review Li Zefan 1 participant 1 message Dec 6, 2007 Char and misc drivers

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 2/3 DRM: don't cast a pointer to pointer of list_head

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

---
 drivers/char/drm/i915_irq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/drm/i915_irq.c +1 -1
index a443f4a..e9e8522 100644
@@ -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);
Signature · 1 line
1.5.3.rc7