Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1708635
| From | Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 04/12] [media] V4L2: platform: rcar_jpu: constify v4l2_m2m_ops structures |
| Date | 2017-08-10 15:40 +0200 |
| Message-ID | <ucVQS-6aH-13@gated-at.bofh.it> (permalink) |
| References | <ubpzI-8qn-7@gated-at.bofh.it> <ubpzI-8qn-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sun, Aug 6, 2017 at 11:25 AM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> The v4l2_m2m_ops structures are only passed as the only
> argument to v4l2_m2m_init, which is declared as const.
> Thus the v4l2_m2m_ops structures themselves can be const.
>
> Done with the help of Coccinelle.
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct v4l2_m2m_ops i@p = { ... };
>
> @ok1@
> identifier r.i;
> position p;
> @@
> v4l2_m2m_init(&i@p)
>
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct v4l2_m2m_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct v4l2_m2m_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Ulyanov Mikhail <mikhail.ulyanov@cogentembedded.com>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 04/12] [media] V4L2: platform: rcar_jpu: constify v4l2_m2m_ops structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-08-06 11:00 +0200 Re: [PATCH 04/12] [media] V4L2: platform: rcar_jpu: constify v4l2_m2m_ops structures Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com> - 2017-08-10 15:40 +0200
csiph-web