* [PATCH] tee: tee_shm: Constify dma_buf_ops structures.
@ 2017-07-01 12:26 Arvind Yadav
2017-07-05 6:58 ` Jens Wiklander
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-07-01 12:26 UTC (permalink / raw)
To: jens.wiklander; +Cc: linux-kernel
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>
---
drivers/tee/tee_shm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c
index d356d7f0..4bc7956 100644
--- a/drivers/tee/tee_shm.c
+++ b/drivers/tee/tee_shm.c
@@ -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,
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tee: tee_shm: Constify dma_buf_ops structures.
2017-07-01 12:26 [PATCH] tee: tee_shm: Constify dma_buf_ops structures Arvind Yadav
@ 2017-07-05 6:58 ` Jens Wiklander
0 siblings, 0 replies; 2+ messages in thread
From: Jens Wiklander @ 2017-07-05 6:58 UTC (permalink / raw)
To: Arvind Yadav; +Cc: linux-kernel
On Sat, Jul 01, 2017 at 05:56:06PM +0530, Arvind Yadav wrote:
> 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>
Looks good to me, queueing this.
Thanks,
Jens
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-05 6:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-01 12:26 [PATCH] tee: tee_shm: Constify dma_buf_ops structures Arvind Yadav
2017-07-05 6:58 ` Jens Wiklander
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).