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

Muhammad Falak R Wani falakreyaz at gmail.com
Sun May 1 13:00:44 UTC 2016


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>

Signed-off-by: Muhammad Falak R Wani <falakreyaz at gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 9a8c5b7..c842dc4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -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);
-- 
1.9.1



More information about the dri-devel mailing list