* [PATCH] drm/udl: dma-buf: Constify dma_buf_ops structures.
@ 2017-07-01 12:36 Arvind Yadav
2017-07-03 8:08 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-07-01 12:36 UTC (permalink / raw)
To: airlied, airlied, daniel.vetter; +Cc: dri-devel, 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
2002 112 0 2114 842 drivers/gpu/drm/udl/udl_dmabuf.o
File size After adding 'const':
text data bss dec hex filename
2114 0 0 2114 842 drivers/gpu/drm/udl/udl_dmabuf.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/gpu/drm/udl/udl_dmabuf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/udl/udl_dmabuf.c b/drivers/gpu/drm/udl/udl_dmabuf.c
index ed0e636..61a5a5f 100644
--- a/drivers/gpu/drm/udl/udl_dmabuf.c
+++ b/drivers/gpu/drm/udl/udl_dmabuf.c
@@ -186,7 +186,7 @@ static int udl_dmabuf_mmap(struct dma_buf *dma_buf,
return -EINVAL;
}
-static struct dma_buf_ops udl_dmabuf_ops = {
+static const struct dma_buf_ops udl_dmabuf_ops = {
.attach = udl_attach_dma_buf,
.detach = udl_detach_dma_buf,
.map_dma_buf = udl_map_dma_buf,
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/udl: dma-buf: Constify dma_buf_ops structures.
2017-07-01 12:36 [PATCH] drm/udl: dma-buf: Constify dma_buf_ops structures Arvind Yadav
@ 2017-07-03 8:08 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2017-07-03 8:08 UTC (permalink / raw)
To: Arvind Yadav; +Cc: airlied, airlied, daniel.vetter, dri-devel, linux-kernel
On Sat, Jul 01, 2017 at 06:06:46PM +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
> 2002 112 0 2114 842 drivers/gpu/drm/udl/udl_dmabuf.o
>
> File size After adding 'const':
> text data bss dec hex filename
> 2114 0 0 2114 842 drivers/gpu/drm/udl/udl_dmabuf.o
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
I merged the two armada and the one udl fix to drm-misc-next for 4.14.
I'll leave the radeon one to Alex.
Thanks, Daniel
> ---
> drivers/gpu/drm/udl/udl_dmabuf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/udl/udl_dmabuf.c b/drivers/gpu/drm/udl/udl_dmabuf.c
> index ed0e636..61a5a5f 100644
> --- a/drivers/gpu/drm/udl/udl_dmabuf.c
> +++ b/drivers/gpu/drm/udl/udl_dmabuf.c
> @@ -186,7 +186,7 @@ static int udl_dmabuf_mmap(struct dma_buf *dma_buf,
> return -EINVAL;
> }
>
> -static struct dma_buf_ops udl_dmabuf_ops = {
> +static const struct dma_buf_ops udl_dmabuf_ops = {
> .attach = udl_attach_dma_buf,
> .detach = udl_detach_dma_buf,
> .map_dma_buf = udl_map_dma_buf,
> --
> 2.7.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-03 8:08 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:36 [PATCH] drm/udl: dma-buf: Constify dma_buf_ops structures Arvind Yadav
2017-07-03 8:08 ` Daniel Vetter
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).