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

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

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

authored by

Arvind Yadav and committed by
Jens Wiklander
53e3ca5c 999616b8

+1 -1
+1 -1
drivers/tee/tee_shm.c
··· 80 80 size, vma->vm_page_prot); 81 81 } 82 82 83 - static struct dma_buf_ops tee_shm_dma_buf_ops = { 83 + static const struct dma_buf_ops tee_shm_dma_buf_ops = { 84 84 .map_dma_buf = tee_shm_op_map_dma_buf, 85 85 .unmap_dma_buf = tee_shm_op_unmap_dma_buf, 86 86 .release = tee_shm_op_release,