From: Muhammad Falak R Wani Date: Sat, 30 Apr 2016 19:00:24 +0000 (+0530) Subject: drm/amdgpu: Replace rcu_assign_pointer() with RCU_INIT_POINTER() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=84fae133f0ccc974a425eee21101f5644bd8d14d;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: Replace rcu_assign_pointer() with RCU_INIT_POINTER() The rcu_assign_pointer() ensures that the initialization of a structure is carried out before storing a pointer to that structre. It is always safe to use RCU_INIT_POINTER() to NULL a pointer, instead of rcu_assign_pointer(). This results in slightly smaller/faster code. The following semantic patch was used: @@ @@ - rcu_assign_pointer + RCU_INIT_POINTER (..., NULL) Reviewed-by: Christian König Signed-off-by: Muhammad Falak R Wani Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 50e95ab9615a..ba9c04283d01 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -198,7 +198,7 @@ void amdgpu_fence_process(struct amdgpu_ring *ring) /* There is always exactly one thread signaling this fence slot */ fence = rcu_dereference_protected(*ptr, 1); - rcu_assign_pointer(*ptr, NULL); + RCU_INIT_POINTER(*ptr, NULL); BUG_ON(!fence);