From patchwork Sat Aug 26 13:11:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9923527 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 73D76603FF for ; Sat, 26 Aug 2017 13:12:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5287C285D2 for ; Sat, 26 Aug 2017 13:12:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 477332859A; Sat, 26 Aug 2017 13:12:20 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable 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 CB57B285DD for ; Sat, 26 Aug 2017 13:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754692AbdHZNLr (ORCPT ); Sat, 26 Aug 2017 09:11:47 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33822 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752480AbdHZNLp (ORCPT ); Sat, 26 Aug 2017 09:11:45 -0400 Received: by mail-pf0-f194.google.com with SMTP id p69so942189pfk.1; Sat, 26 Aug 2017 06:11:45 -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=gOtsr9lN8sZEa+BlmuAqUar9QE9mKLbL6AVpZDD5KVU=; b=AO/pbHsZynrtO/PzkuA6VruGrmwq1cX++cAy7Tfd+S3ZHxy6XMAFZzyR98/FlZpImi QKbgRezjOL4xtuBBXPjjvfJao27MnJoU4HauOPyWuM7V4+NAvJvUe8NGyBN2pj2cVW54 BHfq6hFio6rqE9qu76f42fs0X/FqdlC+wo8YUP7t4OW6e0MpyFKXuf7TU37a3RW4t5YS 7joHRVlCtbDYeIuKA9l/3pGM52zsNuu+oO/Y5KOHrjdfpqo/20Om7BSM/ZnOpniekacq CMkCCwDfpPFK1jLH0w2oL0Fw56Z2uP9Poe8KcuN8yb5zfkcymOPwoTl6iYvOI2miKeiS 8j0Q== 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=gOtsr9lN8sZEa+BlmuAqUar9QE9mKLbL6AVpZDD5KVU=; b=NKKwp75MJmVCtYX7M+0jVurzIDUC0Cw5jAB1aqIxh6SAb4+MFjcMHRhe0pLJFFhqxb HsO4VVU4xEWaR8IUALQMfpPDkIgoBPkF67sW/TRQrWoytd03gTn66b/YrXp5gpkrDZr4 l65wY/DqgCWbgMOzQK2JSJmFPxqncSToz5z78xxeZB0Cd2cKfRmSOQqSdW8bn1gkHm5X 183dM/Kh8ARzDih2ySMyeTMNVVqG1QYbpwH7vvsMAjWAMrFWtlRr8Dukkp1kaKsAFOqH irTgup6NbBbjjh2Seyfe6HSvkeM+Ekdw1Gu6m9j+ZyoFYjR14zEXLgrIup23pf0ho0XJ OJWg== X-Gm-Message-State: AHYfb5g3hR62gP/PFTf+Eoc32XZr2ydbZElirxn5pz+6tC/pGyhSVpJt oQX0E80mwSpIJQ== X-Received: by 10.84.212.144 with SMTP id e16mr1902184pli.115.1503753105066; Sat, 26 Aug 2017 06:11:45 -0700 (PDT) Received: from gmail.com ([117.196.107.182]) by smtp.gmail.com with ESMTPSA id v3sm5776982pgc.7.2017.08.26.06.11.39 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 26 Aug 2017 06:11:44 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Sat, 26 Aug 2017 18:41:36 +0530 From: Bhumika Goyal To: julia.lawall@lip.fr, crope@iki.fi, mchehab@kernel.org, hans.verkuil@cisco.com, isely@pobox.com, ezequiel@vanguardiasur.com.ar, royale@zerezo.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH v2] [media] usb: make video_device const Date: Sat, 26 Aug 2017 18:41:30 +0530 Message-Id: <1503753090-19987-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 only used during a copy operation. Signed-off-by: Bhumika Goyal Acked-by: Mike Isely --- Changes in v2: * Combine the patch series sent for drivers/media/usb/ into a single patch. drivers/media/usb/airspy/airspy.c | 2 +- drivers/media/usb/cpia2/cpia2_v4l.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 2 +- drivers/media/usb/msi2500/msi2500.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 2 +- drivers/media/usb/pwc/pwc-if.c | 2 +- drivers/media/usb/s2255/s2255drv.c | 2 +- drivers/media/usb/stk1160/stk1160-v4l.c | 2 +- drivers/media/usb/stkwebcam/stk-webcam.c | 2 +- drivers/media/usb/zr364xx/zr364xx.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index 07f3f4e..e70c9e2 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c @@ -859,7 +859,7 @@ static int airspy_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device airspy_template = { +static const struct video_device airspy_template = { .name = "AirSpy SDR", .release = video_device_release_empty, .fops = &airspy_fops, diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c index 7122023..3dedd83 100644 --- a/drivers/media/usb/cpia2/cpia2_v4l.c +++ b/drivers/media/usb/cpia2/cpia2_v4l.c @@ -1075,7 +1075,7 @@ static void reset_camera_struct_v4l(struct camera_data *cam) .mmap = cpia2_mmap, }; -static struct video_device cpia2_template = { +static const struct video_device cpia2_template = { /* I could not find any place for the old .initialize initializer?? */ .name = "CPiA2 Camera", .fops = &cpia2_fops, diff --git a/drivers/media/usb/go7007/go7007-v4l2.c b/drivers/media/usb/go7007/go7007-v4l2.c index 445f17b..98cd57e 100644 --- a/drivers/media/usb/go7007/go7007-v4l2.c +++ b/drivers/media/usb/go7007/go7007-v4l2.c @@ -901,7 +901,7 @@ static int go7007_s_ctrl(struct v4l2_ctrl *ctrl) .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; -static struct video_device go7007_template = { +static const struct video_device go7007_template = { .name = "go7007", .fops = &go7007_fops, .release = video_device_release_empty, diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index a41b305..7eb5351 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c @@ -1263,7 +1263,7 @@ static int hackrf_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device hackrf_template = { +static const struct video_device hackrf_template = { .name = "HackRF One", .release = video_device_release_empty, .fops = &hackrf_fops, diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c index 79bfd2d..a097d3d 100644 --- a/drivers/media/usb/msi2500/msi2500.c +++ b/drivers/media/usb/msi2500/msi2500.c @@ -1143,7 +1143,7 @@ static int msi2500_enum_freq_bands(struct file *file, void *priv, .unlocked_ioctl = video_ioctl2, }; -static struct video_device msi2500_template = { +static const struct video_device msi2500_template = { .name = "Mirics MSi3101 SDR Dongle", .release = video_device_release_empty, .fops = &msi2500_fops, diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index 8f13c60..4320bda 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -1226,7 +1226,7 @@ static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait) }; -static struct video_device vdev_template = { +static const struct video_device vdev_template = { .fops = &vdev_fops, }; diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c index 22420c1..eb6921d 100644 --- a/drivers/media/usb/pwc/pwc-if.c +++ b/drivers/media/usb/pwc/pwc-if.c @@ -146,7 +146,7 @@ .mmap = vb2_fop_mmap, .unlocked_ioctl = video_ioctl2, }; -static struct video_device pwc_template = { +static const struct video_device pwc_template = { .name = "Philips Webcam", /* Filled in later */ .release = video_device_release_empty, .fops = &pwc_fops, diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index 23f606e..b2f239c 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -1590,7 +1590,7 @@ static void s2255_video_device_release(struct video_device *vdev) return; } -static struct video_device template = { +static const struct video_device template = { .name = "s2255v", .fops = &s2255_fops_v4l, .ioctl_ops = &s2255_ioctl_ops, diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c index a132faa..77b759a 100644 --- a/drivers/media/usb/stk1160/stk1160-v4l.c +++ b/drivers/media/usb/stk1160/stk1160-v4l.c @@ -751,7 +751,7 @@ static void stop_streaming(struct vb2_queue *vq) .wait_finish = vb2_ops_wait_finish, }; -static struct video_device v4l_template = { +static const struct video_device v4l_template = { .name = "stk1160", .tvnorms = V4L2_STD_525_60 | V4L2_STD_625_50, .fops = &stk1160_fops, diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c index 39abb58..c0bba77 100644 --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c @@ -1244,7 +1244,7 @@ static void stk_v4l_dev_release(struct video_device *vd) kfree(dev); } -static struct video_device stk_v4l_data = { +static const struct video_device stk_v4l_data = { .name = "stkwebcam", .fops = &v4l_stk_fops, .ioctl_ops = &v4l_stk_ioctl_ops, diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index d4bb56b..4ff8d0a 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c @@ -1335,7 +1335,7 @@ static unsigned int zr364xx_poll(struct file *file, .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; -static struct video_device zr364xx_template = { +static const struct video_device zr364xx_template = { .name = DRIVER_DESC, .fops = &zr364xx_fops, .ioctl_ops = &zr364xx_ioctl_ops,