From patchwork Sun Aug 6 08:25:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9883617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0AEB8603B4 for ; Sun, 6 Aug 2017 08:52:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF8FA28632 for ; Sun, 6 Aug 2017 08:52:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E42DF2864A; Sun, 6 Aug 2017 08:52:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 242B028632 for ; Sun, 6 Aug 2017 08:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wyBZMun3iWIaOvThzVn3VdXSiNJvWWHLBNJ4zthstJw=; b=EITrtsWY6k0lYxQIMPnOuNjv8/ hiOlpH3fXJD7VoR/ZPg38NFGoCrwohHkLvw1uZyAwL2UbvlbtYOYiYUjDwi3MUqbK4hCxX5HfYer+ LB4NSGznH77iYo2wCx9GC3xgC8Y0LNDjKcLUsM7GL6XVGqugpaoXHNrQG8YD/RyWR+Qze2SrsNyXz b0Whlf8KdU5M5IB8WCELsFPxkvJNvUBNkuiXaCrkAs8LzYqd8USY57bhMT0o4xQ+TGd2qIuiETLII XHFOIIzIIJECnmY5qT00YrXUx63Bvb9/sMe6W8ynPAqYaKiKshoch/glJ2ZeWY4+JVbVfC7QLzhvJ JtaAdwZg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1deHIW-0004Vc-JS; Sun, 06 Aug 2017 08:52:32 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1deHHl-0003XU-8l for linux-arm-kernel@lists.infradead.org; Sun, 06 Aug 2017 08:51:50 +0000 X-IronPort-AV: E=Sophos;i="5.41,331,1498514400"; d="scan'208";a="233780801" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA256; 06 Aug 2017 10:50:56 +0200 From: Julia Lawall To: Kyungmin Park Subject: [PATCH 11/12] [media] exynos4-is: constify v4l2_m2m_ops structures Date: Sun, 6 Aug 2017 10:25:20 +0200 Message-Id: <1502007921-22968-12-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502007921-22968-1-git-send-email-Julia.Lawall@lip6.fr> References: <1502007921-22968-1-git-send-email-Julia.Lawall@lip6.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170806_015146_304010_15071C4E X-CRM114-Status: GOOD ( 10.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Kukjin Kim , linux-arm-kernel@lists.infradead.org, Sylwester Nawrocki , Mauro Carvalho Chehab , bhumirks@gmail.com, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The v4l2_m2m_ops structures are only passed as the only argument to v4l2_m2m_init, which is declared as const. Thus the v4l2_m2m_ops structures themselves can be const. Done with the help of Coccinelle. // @r disable optional_qualifier@ identifier i; position p; @@ static struct v4l2_m2m_ops i@p = { ... }; @ok1@ identifier r.i; position p; @@ v4l2_m2m_init(&i@p) @bad@ position p != {r.p,ok1.p}; identifier r.i; struct v4l2_m2m_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct v4l2_m2m_ops i = { ... }; // Signed-off-by: Julia Lawall Reviewed-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/fimc-m2m.c b/drivers/media/platform/exynos4-is/fimc-m2m.c index d8724fe..9027d0b 100644 --- a/drivers/media/platform/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/exynos4-is/fimc-m2m.c @@ -704,7 +704,7 @@ static int fimc_m2m_release(struct file *file) .mmap = v4l2_m2m_fop_mmap, }; -static struct v4l2_m2m_ops m2m_ops = { +static const struct v4l2_m2m_ops m2m_ops = { .device_run = fimc_device_run, .job_abort = fimc_job_abort, };