Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbdGBGUG (ORCPT ); Sun, 2 Jul 2017 02:20:06 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33802 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750770AbdGBGUE (ORCPT ); Sun, 2 Jul 2017 02:20:04 -0400 From: Arvind Yadav To: tomi.valkeinen@ti.com, airlied@linux.ie Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/omap: dma-buf: Constify dma_buf_ops structures. Date: Sun, 2 Jul 2017 11:49:40 +0530 Message-Id: <1fcfd1f541f71bf229919e94197716e55e8fd2ad.1498976230.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1236 Lines: 32 dma_buf_ops are not supposed to change at runtime. All functions working with dma_buf_ops provided by 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 --- 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