]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dma-buf: cleanup dma_fence_chain_walk
authorChristian König <christian.koenig@amd.com>
Wed, 11 May 2022 15:40:38 +0000 (17:40 +0200)
committerChristian König <christian.koenig@amd.com>
Mon, 30 May 2022 09:24:50 +0000 (11:24 +0200)
Use unrcu_pointer() instead of the manual cast.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220518085446.31338-1-christian.koenig@amd.com
drivers/dma-buf/dma-fence-chain.c

index 06f8ef97c6e8c91c8f24f0753c1dd849ef79fcf7..a0d920576ba65488eb8e7f9b2f9224c92eae83c1 100644 (file)
@@ -62,8 +62,8 @@ struct dma_fence *dma_fence_chain_walk(struct dma_fence *fence)
                        replacement = NULL;
                }
 
-               tmp = cmpxchg((struct dma_fence __force **)&chain->prev,
-                             prev, replacement);
+               tmp = unrcu_pointer(cmpxchg(&chain->prev, RCU_INITIALIZER(prev),
+                                            RCU_INITIALIZER(replacement)));
                if (tmp == prev)
                        dma_fence_put(tmp);
                else