Skip to content

Commit 1c530d4

Browse files
committed
dma-buf: Use atomic_fetch_add() for the context id
Now that atomic64_fetch_add() exists we can use it to return the base context id, rather than the atomic64_add_return(N) - N concoction. Suggested-by: Mika Kuoppala <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Reviewed-by: Maciej Patelczyk <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 761e9f4 commit 1c530d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma-buf/dma-fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ EXPORT_SYMBOL(dma_fence_get_stub);
106106
u64 dma_fence_context_alloc(unsigned num)
107107
{
108108
WARN_ON(!num);
109-
return atomic64_add_return(num, &dma_fence_context_counter) - num;
109+
return atomic64_fetch_add(num, &dma_fence_context_counter);
110110
}
111111
EXPORT_SYMBOL(dma_fence_context_alloc);
112112

0 commit comments

Comments
 (0)