[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1fcfd1f541f71bf229919e94197716e55e8fd2ad.1498976230.git.arvind.yadav.cs@gmail.com>
Date: Sun, 2 Jul 2017 11:49:40 +0530
From: Arvind Yadav <arvind.yadav.cs@...il.com>
To: tomi.valkeinen@...com, airlied@...ux.ie
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drm/omap: dma-buf: 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
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@...il.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
Powered by blists - more mailing lists