From: Julia Lawall <Julia.Lawall@lip6.fr>
To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Cc: bhumirks@gmail.com, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/6] [media] v4l2-pci-skeleton: constify vb2_ops structures
Date: Sat, 5 Aug 2017 12:47:08 +0200 [thread overview]
Message-ID: <1501930033-18249-2-git-send-email-Julia.Lawall@lip6.fr> (raw)
In-Reply-To: <1501930033-18249-1-git-send-email-Julia.Lawall@lip6.fr>
These vb2_ops structures are only stored in the ops field of a
vb2_queue structure, which is declared as const. Thus the vb2_ops
structures themselves can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct vb2_ops i@p = { ... };
@ok@
identifier r.i;
struct vb2_queue e;
position p;
@@
e.ops = &i@p;
@bad@
position p != {r.p,ok.p};
identifier r.i;
struct vb2_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct vb2_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
There doesn't seem to be a maintainer for this file.
samples/v4l/v4l2-pci-skeleton.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/v4l/v4l2-pci-skeleton.c b/samples/v4l/v4l2-pci-skeleton.c
index 93b76c3..483e9bca 100644
--- a/samples/v4l/v4l2-pci-skeleton.c
+++ b/samples/v4l/v4l2-pci-skeleton.c
@@ -282,7 +282,7 @@ static void stop_streaming(struct vb2_queue *vq)
* vb2_ops_wait_prepare/finish helper functions. If q->lock would be NULL,
* then this driver would have to provide these ops.
*/
-static struct vb2_ops skel_qops = {
+static const struct vb2_ops skel_qops = {
.queue_setup = queue_setup,
.buf_prepare = buffer_prepare,
.buf_queue = buffer_queue,
next prev parent reply other threads:[~2017-08-05 11:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-05 10:47 [PATCH 0/6] " Julia Lawall
2017-08-05 10:47 ` Julia Lawall [this message]
2017-08-05 10:47 ` [PATCH 2/6] [media] media: davinci: vpbe: " Julia Lawall
2017-08-05 10:47 ` [PATCH 3/6] [media] staging: media: davinci_vpfe: " Julia Lawall
2017-08-05 10:47 ` [PATCH 4/6] [media] media: blackfin: bfin_capture: " Julia Lawall
2017-08-05 10:47 ` [PATCH 5/6] staging: bcm2835-camera: " Julia Lawall
2017-08-05 10:47 ` [PATCH 6/6] [media] media: imx: capture: " Julia Lawall
2017-08-14 23:14 ` Steve Longerbeam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1501930033-18249-2-git-send-email-Julia.Lawall@lip6.fr \
--to=julia.lawall@lip6.fr \
--cc=bhumirks@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®