Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-buf: cleanup dma_fence_chain_walk

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

+2 -2
+2 -2
drivers/dma-buf/dma-fence-chain.c
··· 62 62 replacement = NULL; 63 63 } 64 64 65 - tmp = cmpxchg((struct dma_fence __force **)&chain->prev, 66 - prev, replacement); 65 + tmp = unrcu_pointer(cmpxchg(&chain->prev, RCU_INITIALIZER(prev), 66 + RCU_INITIALIZER(replacement))); 67 67 if (tmp == prev) 68 68 dma_fence_put(tmp); 69 69 else