From patchwork Wed Sep 13 19:37:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9951921 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 F305B603FB for ; Wed, 13 Sep 2017 19:38:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3D1B28CCA for ; Wed, 13 Sep 2017 19:38:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D810828D8B; Wed, 13 Sep 2017 19:38:35 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 D78D828D6A for ; Wed, 13 Sep 2017 19:38:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752125AbdIMTiJ (ORCPT ); Wed, 13 Sep 2017 15:38:09 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35430 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbdIMTiI (ORCPT ); Wed, 13 Sep 2017 15:38:08 -0400 Received: by mail-pf0-f194.google.com with SMTP id i23so474786pfi.2; Wed, 13 Sep 2017 12:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=MqyjeYw8mIYVKjMVb+ebEHrLHVR6ohOPG8IiQ0oFWTo=; b=U7e3FOooFj2M2thVaQjfRmNTAZZo1DrOfHL6CR1TfYeeGmPJy4CFGseK34AIguuAlr iMl6Lk98V3S0T/8EclOU3rCXXQeCtRLCyXT3Oyg0AUCU5x83dHQGlZBPdYVA62/dJfZZ cXmuzJRzrztgX2BPMZKtDClbrgD6d6eDUR7EGY6p4nAU3Ti5Ar7xF/eq4pWqFtec9Dol QgCU3VMl8ekYlIZkkT1dW55AYXfCAGT9gSXbQuflDrJSps0tnN+4mzflngnfgsAxhJxi 5Tf8xuUH5iLHJE4IRRvonOedXCzCKoaRmJoXuk6bU2DUnl68+fVvZBb2/KB8EG+pinUP uD4g== 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=MqyjeYw8mIYVKjMVb+ebEHrLHVR6ohOPG8IiQ0oFWTo=; b=bX8Sr6poJXOm7E91F1pTfs+/K/6jCCuBvxBKub4VSygp22Cp3hwVi/+qHqZZriD5zU 61H31SjxIigAs91mp0AKS5iUhtRVVZaZ5lEewaN0nr4STt9GE4Uv8FovQ6y19lv2oWAX zrvePhn709JZFzB8z7bQoATWbkeSg0Wc479X15CAipP3RJgZc4/gthZvVRI2GD6TdlSW XBkuITFXO+RVMUIKwjuf5p3Y8kHYVwxsc9tvmk7jiEHleWzlk1c7u6ACta4jDYlYROH+ IiVqiiOrIr/j486IQeXnrd1v+4R3eHPpgpfhPhWGrEuDujBwEMBHr9Ia0ppwpkgv1IbC 4o3w== X-Gm-Message-State: AHPjjUihS1R5muWMZZSGgPpPP3Yzy3oVQqgVG3svDsCawBExa5KiPMwN Y9Uels8sA/uPpw== X-Google-Smtp-Source: ADKCNb7wHZCwMyDN30qnLyRRtZJeBAdWkVrpG2ShMj6kTdtJuqUQfG3ZZVgjyks3Fpa2Tj0OYEaWcA== X-Received: by 10.98.193.2 with SMTP id i2mr18532085pfg.207.1505331487750; Wed, 13 Sep 2017 12:38:07 -0700 (PDT) Received: from gmail.com ([117.196.99.243]) by smtp.gmail.com with ESMTPSA id i87sm18668315pfi.184.2017.09.13.12.38.04 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 13 Sep 2017 12:38:07 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Thu, 14 Sep 2017 01:08:00 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] [media] saa7146: make saa7146_use_ops const Date: Thu, 14 Sep 2017 01:07:50 +0530 Message-Id: <1505331470-28925-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make these const as they are not modified in the file referencing them. They are only used when their function pointer fields invokes a function and therefore none of the structure fields are getting modified. Also, add a const to the declaration in the header. Signed-off-by: Bhumika Goyal --- drivers/media/common/saa7146/saa7146_vbi.c | 2 +- drivers/media/common/saa7146/saa7146_video.c | 2 +- include/media/drv-intf/saa7146_vv.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/common/saa7146/saa7146_vbi.c b/drivers/media/common/saa7146/saa7146_vbi.c index d79e4d7..69525ca 100644 --- a/drivers/media/common/saa7146/saa7146_vbi.c +++ b/drivers/media/common/saa7146/saa7146_vbi.c @@ -488,7 +488,7 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff return ret; } -struct saa7146_use_ops saa7146_vbi_uops = { +const struct saa7146_use_ops saa7146_vbi_uops = { .init = vbi_init, .open = vbi_open, .release = vbi_close, diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c index 37b4654..51eeed8 100644 --- a/drivers/media/common/saa7146/saa7146_video.c +++ b/drivers/media/common/saa7146/saa7146_video.c @@ -1303,7 +1303,7 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo return ret; } -struct saa7146_use_ops saa7146_video_uops = { +const struct saa7146_use_ops saa7146_video_uops = { .init = video_init, .open = video_open, .release = video_close, diff --git a/include/media/drv-intf/saa7146_vv.h b/include/media/drv-intf/saa7146_vv.h index 0da6ccc..736f4f2 100644 --- a/include/media/drv-intf/saa7146_vv.h +++ b/include/media/drv-intf/saa7146_vv.h @@ -202,14 +202,14 @@ void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q, /* from saa7146_video.c */ extern const struct v4l2_ioctl_ops saa7146_video_ioctl_ops; extern const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops; -extern struct saa7146_use_ops saa7146_video_uops; +extern const struct saa7146_use_ops saa7146_video_uops; int saa7146_start_preview(struct saa7146_fh *fh); int saa7146_stop_preview(struct saa7146_fh *fh); long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); int saa7146_s_ctrl(struct v4l2_ctrl *ctrl); /* from saa7146_vbi.c */ -extern struct saa7146_use_ops saa7146_vbi_uops; +extern const struct saa7146_use_ops saa7146_vbi_uops; /* resource management functions */ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit);