* [PATCH] drm/omap: dma-buf: Constify dma_buf_ops structures.
@ 2017-07-02 6:19 Arvind Yadav
2017-08-08 12:30 ` Tomi Valkeinen
0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-07-02 6:19 UTC (permalink / raw)
To: tomi.valkeinen, airlied; +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
1240 112 0 1352 548 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.o
File size After adding 'const':
text data bss dec hex filename
1352 0 0 1352 548 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
index 0dbe030..a03bc36 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
@@ -154,7 +154,7 @@ static int omap_gem_dmabuf_mmap(struct dma_buf *buffer,
return omap_gem_mmap_obj(obj, vma);
}
-static struct dma_buf_ops omap_dmabuf_ops = {
+static const struct dma_buf_ops omap_dmabuf_ops = {
.map_dma_buf = omap_gem_map_dma_buf,
.unmap_dma_buf = omap_gem_unmap_dma_buf,
.release = omap_gem_dmabuf_release,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/omap: dma-buf: Constify dma_buf_ops structures.
2017-07-02 6:19 [PATCH] drm/omap: dma-buf: Constify dma_buf_ops structures Arvind Yadav
@ 2017-08-08 12:30 ` Tomi Valkeinen
0 siblings, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2017-08-08 12:30 UTC (permalink / raw)
To: Arvind Yadav; +Cc: airlied, dri-devel, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1453 bytes --]
On 02/07/17 09:19, 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
> 1240 112 0 1352 548 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.o
>
> File size After adding 'const':
> text data bss dec hex filename
> 1352 0 0 1352 548 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.o
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
> index 0dbe030..a03bc36 100644
> --- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
> +++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
> @@ -154,7 +154,7 @@ static int omap_gem_dmabuf_mmap(struct dma_buf *buffer,
> return omap_gem_mmap_obj(obj, vma);
> }
>
> -static struct dma_buf_ops omap_dmabuf_ops = {
> +static const struct dma_buf_ops omap_dmabuf_ops = {
> .map_dma_buf = omap_gem_map_dma_buf,
> .unmap_dma_buf = omap_gem_unmap_dma_buf,
> .release = omap_gem_dmabuf_release,
>
Thanks! I've picked this and the 3 other constifying patches to omapdrm
tree.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/omap: dma-buf: Constify dma_buf_ops structures.
@ 2017-08-08 12:30 ` Tomi Valkeinen
0 siblings, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2017-08-08 12:30 UTC (permalink / raw)
To: Arvind Yadav; +Cc: airlied, dri-devel, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1453 bytes --]
On 02/07/17 09:19, 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
> 1240 112 0 1352 548 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.o
>
> File size After adding 'const':
> text data bss dec hex filename
> 1352 0 0 1352 548 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.o
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
> index 0dbe030..a03bc36 100644
> --- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
> +++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
> @@ -154,7 +154,7 @@ static int omap_gem_dmabuf_mmap(struct dma_buf *buffer,
> return omap_gem_mmap_obj(obj, vma);
> }
>
> -static struct dma_buf_ops omap_dmabuf_ops = {
> +static const struct dma_buf_ops omap_dmabuf_ops = {
> .map_dma_buf = omap_gem_map_dma_buf,
> .unmap_dma_buf = omap_gem_unmap_dma_buf,
> .release = omap_gem_dmabuf_release,
>
Thanks! I've picked this and the 3 other constifying patches to omapdrm
tree.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-08 12:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-02 6:19 [PATCH] drm/omap: dma-buf: Constify dma_buf_ops structures Arvind Yadav
2017-08-08 12:30 ` Tomi Valkeinen
2017-08-08 12:30 ` Tomi Valkeinen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.