From patchwork Wed Dec 14 03:55:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9473685 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 EF8076021C for ; Wed, 14 Dec 2016 03:58:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2E3E286E8 for ; Wed, 14 Dec 2016 03:58:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C43E6286ED; Wed, 14 Dec 2016 03:58:41 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CA41286E8 for ; Wed, 14 Dec 2016 03:58:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753269AbcLND6j (ORCPT ); Tue, 13 Dec 2016 22:58:39 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33079 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753230AbcLND6i (ORCPT ); Tue, 13 Dec 2016 22:58:38 -0500 Received: by mail-pg0-f65.google.com with SMTP id 3so906643pgd.0; Tue, 13 Dec 2016 19:56:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=TKw0GNQHVUhGl9NhnsTS+5EV6uqtX6pDHgVDNCXdQPc=; b=iB6XGG+0HzvX2yswoWVXFGgCuSmPcp8dr+ERmgEgot0GdQ74G52FNF5dHmAFbv9jom 3mJuxZ4azTMkZjyIWTNwHarEqlDSANQ3iOO2tL1zYGdR5/QVKsvVzbpd2JjZXs1iW4+2 oMlt+RimrUpc/7TKdyjoOZ9ATwOfFq9fLZ/fXsYM875Lpd2GhIgWmOdHhY8Zcb4e2no8 kw0DyVOKLh4pS9NKzMge1DsM9M9RZPxi3pQ6RqZ+TLG1IVgv49MX3uUgFtbWQpxLCr1Q 4XmAlGK86JDZgWyLqMAVI1TCNPoWBnBpom1kTrV6k6GOQdnLH0sA7blpVmEfr23OoVdE X7uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TKw0GNQHVUhGl9NhnsTS+5EV6uqtX6pDHgVDNCXdQPc=; b=hsz5nQ4ZlAsyL5Zvu0NTE3uGmkESfK/Yil5HERJHYr38vT1hMMNJbpRO6oJMzlEn/L SdlKJH6ELVw0nSra85oiRc7KB1o3lWZIVq80Wfcm6VhCeEX42dFKaI9KrodyGJiuZAcI fknqkTQUWhRDVTiMtXwNapWqpfpHLXduhUqYxtll0waaKZlnuKxXeI4VRev5CQNjn8GG qJ/sC5xDpqLRF0rwedPfArCC5MHk4GkYkUW7yC2K/cQoauGRhGts7sSNyejoc2QOFjpV oj9KnKdriJd0GeWWxQJyVRjEKFWmoac4EzgK5yBaMbrv9Mt19IjuSDpOGW0eCgwGavr6 MTsw== X-Gm-Message-State: AKaTC01y4LpLqHTFlnKunEkOqkGEmxIHG2HpPRaR9zjb5tW8s+hlHZIrH5PwF3Kj0nm8gQ== X-Received: by 10.84.210.233 with SMTP id a96mr202765528pli.72.1481687770150; Tue, 13 Dec 2016 19:56:10 -0800 (PST) Received: from gmail.com ([106.215.132.219]) by smtp.gmail.com with ESMTPSA id x123sm83555069pgb.3.2016.12.13.19.55.54 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 13 Dec 2016 19:56:08 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Wed, 14 Dec 2016 09:25:49 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@kernel.org, kgene@kernel.org, krzk@kernel.org, javier@osg.samsung.com, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] media: platform: exynos4-is: constify v4l2_subdev_ops strcutures Date: Wed, 14 Dec 2016 09:25:47 +0530 Message-Id: <1481687747-28785-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check for v4l2_subdev_ops structures that are only passed as an argument to the function v4l2_subdev_init. This argument is of type const, so v4l2_subdev_ops structures having this property can also be declared const. Done using Coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct v4l2_subdev_ops i@p = {...}; @ok1@ identifier r1.i; position p; @@ v4l2_subdev_init(...,&i@p) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct v4l2_subdev_ops i; Before and after size details: text data bss dec hex filename 6743 152 20 6915 1b03 platform/exynos4-is/fimc-isp.o 6807 88 20 6915 1b03 platform/exynos4-is/fimc-isp.o 15653 392 36 16081 3ed1 platform/exynos4-is/fimc-lite.o 15717 308 36 16061 3ebd platform/exynos4-is/fimc-lite.o Signed-off-by: Bhumika Goyal --- drivers/media/platform/exynos4-is/fimc-isp.c | 2 +- drivers/media/platform/exynos4-is/fimc-lite.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-isp.c b/drivers/media/platform/exynos4-is/fimc-isp.c index 8efe916..fd793d3 100644 --- a/drivers/media/platform/exynos4-is/fimc-isp.c +++ b/drivers/media/platform/exynos4-is/fimc-isp.c @@ -433,7 +433,7 @@ static void fimc_isp_subdev_unregistered(struct v4l2_subdev *sd) .s_power = fimc_isp_subdev_s_power, }; -static struct v4l2_subdev_ops fimc_is_subdev_ops = { +static const struct v4l2_subdev_ops fimc_is_subdev_ops = { .core = &fimc_is_core_ops, .video = &fimc_is_subdev_video_ops, .pad = &fimc_is_subdev_pad_ops, diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index b91abf1..18b6aaa 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c @@ -1361,7 +1361,7 @@ static void fimc_lite_subdev_unregistered(struct v4l2_subdev *sd) .log_status = fimc_lite_log_status, }; -static struct v4l2_subdev_ops fimc_lite_subdev_ops = { +static const struct v4l2_subdev_ops fimc_lite_subdev_ops = { .core = &fimc_lite_core_ops, .video = &fimc_lite_subdev_video_ops, .pad = &fimc_lite_subdev_pad_ops,