Skip to content

Commit 0654196

Browse files
ubizjaksumitsemwal
authored andcommitted
dma-buf: Use atomic64_inc_return() in dma_buf_getfile()
Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref) to use optimized implementation and ease register pressure around the primitive for targets that implement optimized variant. Signed-off-by: Uros Bizjak <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: "Christian König" <[email protected]> Signed-off-by: Sumit Semwal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 4a1cb63 commit 0654196

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma-buf/dma-buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ static struct file *dma_buf_getfile(size_t size, int flags)
559559
* Override ->i_ino with the unique and dmabuffs specific
560560
* value.
561561
*/
562-
inode->i_ino = atomic64_add_return(1, &dmabuf_inode);
562+
inode->i_ino = atomic64_inc_return(&dmabuf_inode);
563563
flags &= O_ACCMODE | O_NONBLOCK;
564564
file = alloc_file_pseudo(inode, dma_buf_mnt, "dmabuf",
565565
flags, &dma_buf_fops);

0 commit comments

Comments
 (0)