tee: tee_shm: Constify dma_buf_ops structures.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Sat, 1 Jul 2017 12:26:06 +0000 (17:56 +0530)
committerJens Wiklander <jens.wiklander@linaro.org>
Fri, 4 Aug 2017 08:30:27 +0000 (10:30 +0200)
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>
drivers/tee/tee_shm.c

index d356d7f025eb4cf92cc3c2f6615a2b8dad6f7e36..4bc7956cefc4afcde8e724f47346c2937e45e3e3 100644 (file)
@@ -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,