From patchwork Tue Aug 9 16:03:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9271685 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 5C34F60839 for ; Tue, 9 Aug 2016 16:24:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CCA727F4B for ; Tue, 9 Aug 2016 16:24:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 413A3283DF; Tue, 9 Aug 2016 16:24:07 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C913A27F4B for ; Tue, 9 Aug 2016 16:24:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bX9mn-0003bf-Np; Tue, 09 Aug 2016 16:21:49 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bX9mj-0003ZS-5o; Tue, 09 Aug 2016 16:21:46 +0000 X-IronPort-AV: E=Sophos;i="5.28,495,1464645600"; d="scan'208";a="187294710" Received: from palace.rsr.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA256; 09 Aug 2016 18:21:18 +0200 From: Julia Lawall To: Mauro Carvalho Chehab Subject: [PATCH] [media] mtk-vcodec: constify venc_common_if structures Date: Tue, 9 Aug 2016 18:03:55 +0200 Message-Id: <1470758635-13193-1-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160809_092145_611902_DD1AED19 X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, 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 venc_common_if structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h | 2 +- drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c | 6 +++--- drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c | 6 +++--- drivers/media/platform/mtk-vcodec/venc_drv_if.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index 94f0a42..b0cb3ed 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -240,7 +240,7 @@ struct mtk_vcodec_ctx { enum mtk_encode_param param_change; struct mtk_enc_params enc_params; - struct venc_common_if *enc_if; + const struct venc_common_if *enc_if; unsigned long drv_handle; int int_cond; diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c index 9a60052..532cd36 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c @@ -664,16 +664,16 @@ static int h264_enc_deinit(unsigned long handle) return ret; } -static struct venc_common_if venc_h264_if = { +static const struct venc_common_if venc_h264_if = { h264_enc_init, h264_enc_encode, h264_enc_set_param, h264_enc_deinit, }; -struct venc_common_if *get_h264_enc_comm_if(void); +const struct venc_common_if *get_h264_enc_comm_if(void); -struct venc_common_if *get_h264_enc_comm_if(void) +const struct venc_common_if *get_h264_enc_comm_if(void) { return &venc_h264_if; } diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c index 60bbcd2..bdf6780 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c @@ -471,16 +471,16 @@ static int vp8_enc_deinit(unsigned long handle) return ret; } -static struct venc_common_if venc_vp8_if = { +static const struct venc_common_if venc_vp8_if = { vp8_enc_init, vp8_enc_encode, vp8_enc_set_param, vp8_enc_deinit, }; -struct venc_common_if *get_vp8_enc_comm_if(void); +const struct venc_common_if *get_vp8_enc_comm_if(void); -struct venc_common_if *get_vp8_enc_comm_if(void) +const struct venc_common_if *get_vp8_enc_comm_if(void) { return &venc_vp8_if; } diff --git a/drivers/media/platform/mtk-vcodec/venc_drv_if.c b/drivers/media/platform/mtk-vcodec/venc_drv_if.c index c4c83e7..d02d5f1 100644 --- a/drivers/media/platform/mtk-vcodec/venc_drv_if.c +++ b/drivers/media/platform/mtk-vcodec/venc_drv_if.c @@ -26,8 +26,8 @@ #include "mtk_vcodec_enc_pm.h" #include "mtk_vpu.h" -struct venc_common_if *get_h264_enc_comm_if(void); -struct venc_common_if *get_vp8_enc_comm_if(void); +const struct venc_common_if *get_h264_enc_comm_if(void); +const struct venc_common_if *get_vp8_enc_comm_if(void); int venc_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc) {