]> Git Repo - linux.git/commitdiff
dma-buf: Use atomic_fetch_add() for the context id
authorChris Wilson <[email protected]>
Wed, 13 May 2020 07:47:47 +0000 (08:47 +0100)
committerChris Wilson <[email protected]>
Wed, 13 May 2020 12:38:59 +0000 (13:38 +0100)
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]
drivers/dma-buf/dma-fence.c

index 052a41e2451c182068164816d35c14580c789386..90edf2b281b049381ebfc97d467b15e207a16b83 100644 (file)
@@ -106,7 +106,7 @@ EXPORT_SYMBOL(dma_fence_get_stub);
 u64 dma_fence_context_alloc(unsigned num)
 {
        WARN_ON(!num);
-       return atomic64_add_return(num, &dma_fence_context_counter) - num;
+       return atomic64_fetch_add(num, &dma_fence_context_counter);
 }
 EXPORT_SYMBOL(dma_fence_context_alloc);
 
This page took 0.056207 seconds and 4 git commands to generate.