Skip to contentSkip to conversation

drm/nouveau/fence: use RCU_INIT_POINTER() when NULLing.

PATCH New Muhammad Falak R Wani 1 participant 1 message May 1, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/fence: use RCU_INIT_POINTER() when NULLing.

It is safe to use RCU_INIT_POINTER() to NULL, instead of rcu_assign_pointer().
This results in slightly smaller/faster code.

The follwoing semantic patch was used:
<smpl>
@@
@@
- rcu_assign_pointer
+ RCU_INIT_POINTER
(..., NULL)

</smpl>

---
 drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +1 -1
index 9a8c5b7..c842dc4 100644
@@ -60,7 +60,7 @@ nouveau_fence_signal(struct nouveau_fence *fence)
 
 	fence_signal_locked(&fence->base);
 	list_del(&fence->head);
-	rcu_assign_pointer(fence->channel, NULL);
+	RCU_INIT_POINTER(fence->channel, NULL);
 
 	if (test_bit(FENCE_FLAG_USER_BITS, &fence->base.flags)) {
 		struct nouveau_fence_chan *fctx = nouveau_fctx(fence);
Signature · 1 line
1.9.1