From patchwork Wed Dec 14 11:11:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9474021 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 EF07F60823 for ; Wed, 14 Dec 2016 11:12:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6A512871A for ; Wed, 14 Dec 2016 11:12:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB99C2871F; Wed, 14 Dec 2016 11:12:17 +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 811692871A for ; Wed, 14 Dec 2016 11:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932464AbcLNLLv (ORCPT ); Wed, 14 Dec 2016 06:11:51 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36408 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755099AbcLNLLt (ORCPT ); Wed, 14 Dec 2016 06:11:49 -0500 Received: by mail-pf0-f196.google.com with SMTP id c4so1041220pfb.3; Wed, 14 Dec 2016 03:11:27 -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=8xFOggrxdEnc1nEYavjBYW70K1CrHfVhRZarvXkEY2A=; b=xTo2ksoKjxX6/1dp7qBCbvMLdkIpG4Us6vewRdDqCx/tigyTibz+7JMYhtdkAWG9cL t4ZPsKIK6eGk4Auyt1W9kyPKIhHu1RSfVVMQuYMxlB2tafIEPYDRzBbbid0rkZyVX9oC 0XyM4xq1STA7c2HiCMvEr0c4O0zXTaSczaFzUZRlrpk77RIe6A1KdKbCBWUs2JkyYbGs +vL0RlbiU7WRUA3eaUsttaWlLQNcD5028QtgkSsKOJ3ujf9fb1q695ww7YL7AfwT4hl8 RHKQFzJ5b3pCJHJrQ00ai0FSZXlDSjMoEdA5Fkm9F2A4Qx0NWsOZxRenVQj2aqU9pzpK rFEQ== 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=8xFOggrxdEnc1nEYavjBYW70K1CrHfVhRZarvXkEY2A=; b=NIGD5212gJad5FhumFKzprBiPCO07DOwWT59NFP5pqCPvxx5mQPwr/+GAUeg4juLeQ MGZoa4eTkESXcDPXyj2lgAZCL4JO3EQt9w2ipH1jQYJHfCwV8UqegLrXJHPOw1+MCzxN /aZpBaTr1jZdwhtztiI0oIEnRC90FW9Y06/pk0GX1r8D8kklQOlKRc+6qtb+hBuvlMrb C9pMyu16ksFutK5GrPk+gdq9QVcDsVQMT5M8XeZfJ4Ina9aQrlbgABq1/H+y9uQ+DxSe vu/C7ptJXcPtnOM2Yl/U9Lty+QmhjC7sUMxBkFCvBQoCsRrQJsv05pQPuOv1u82tA32E oT4g== X-Gm-Message-State: AKaTC01g3Loj/L+BOvTYqVDKU02YEoRlBA4gsXEGQC1d7LEx3zLqEGQ0vKvef+QF3ewZYA== X-Received: by 10.84.202.163 with SMTP id x32mr44044389pld.46.1481713886957; Wed, 14 Dec 2016 03:11:26 -0800 (PST) Received: from gmail.com ([106.215.166.87]) by smtp.gmail.com with ESMTPSA id b126sm26116121pfg.52.2016.12.14.03.11.17 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 14 Dec 2016 03:11:25 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Wed, 14 Dec 2016 16:41:11 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, sylvester.nawrocki@gmail.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] media: platform: s3c-camif: constify v4l2_subdev_ops structures Date: Wed, 14 Dec 2016 16:41:10 +0530 Message-Id: <1481713870-7513-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; File size before: text data bss dec hex filename 17171 1912 20 19103 4a9f platform/s3c-camif/camif-capture.o File size after: text data bss dec hex filename 17235 1848 20 19103 4a9f platform/s3c-camif/camif-capture.o Signed-off-by: Bhumika Goyal Acked-by: Sylwester Nawrocki --- drivers/media/platform/s3c-camif/camif-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c index 0413a86..6125e72 100644 --- a/drivers/media/platform/s3c-camif/camif-capture.c +++ b/drivers/media/platform/s3c-camif/camif-capture.c @@ -1488,7 +1488,7 @@ static int s3c_camif_subdev_set_selection(struct v4l2_subdev *sd, .set_fmt = s3c_camif_subdev_set_fmt, }; -static struct v4l2_subdev_ops s3c_camif_subdev_ops = { +static const struct v4l2_subdev_ops s3c_camif_subdev_ops = { .pad = &s3c_camif_subdev_pad_ops, };