Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab64937a authored by Arvind Yadav's avatar Arvind Yadav Committed by Victor Chong
Browse files

BACKPORT: tee: tee_shm: Constify dma_buf_ops structures.



dma_buf_ops are not supposed to change at runtime. All functions
working with dma_buf_ops provided by <linux/dma-buf.h> work with
const dma_buf_ops. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   2026	    112	      0	   2138	    85a	drivers/tee/tee_shm.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   2138	      0	      0	   2138	    85a	drivers/tee/tee_shm.o

Change-Id: I6dfa99c45bf0078d7048525fa0554bc1f607f1e9
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit 53e3ca5cee24f5fafe4e9ff5fe4b230e1a1b85ed)
Signed-off-by: default avatarVictor Chong <victor.chong@linaro.org>
parent 185c2d72
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ static int tee_shm_op_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
			       size, vma->vm_page_prot);
}

static struct dma_buf_ops tee_shm_dma_buf_ops = {
static const struct dma_buf_ops tee_shm_dma_buf_ops = {
	.map_dma_buf = tee_shm_op_map_dma_buf,
	.unmap_dma_buf = tee_shm_op_unmap_dma_buf,
	.release = tee_shm_op_release,