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

Configure Feed

Select the types of activity you want to include in your feed.

dma-buf: Don't misuse dma_fence_signal()

The return code of dma_fence_signal() is not really useful as there is
nothing reasonable to do if a fence was already signaled. That return
code shall be removed from the kernel.

Moreover, dma_fence_signal() should not be used to check whether fences
are signaled. That's what dma_fence_is_signaled() and
dma_fence_test_signaled_flag() exist for.

Replace the non-canonical usage of dma_fence_signal().

Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20251201105011.19386-7-phasta@kernel.org

+2 -2
+2 -2
drivers/dma-buf/st-dma-fence.c
··· 126 126 goto err_free; 127 127 } 128 128 129 - if (dma_fence_signal(f)) { 129 + if (dma_fence_check_and_signal(f)) { 130 130 pr_err("Fence reported being already signaled\n"); 131 131 goto err_free; 132 132 } ··· 136 136 goto err_free; 137 137 } 138 138 139 - if (!dma_fence_signal(f)) { 139 + if (!dma_fence_test_signaled_flag(f)) { 140 140 pr_err("Fence reported not being already signaled\n"); 141 141 goto err_free; 142 142 }