From: Julia Lawall <Julia.Lawall@lip6.fr> To: Hans Verkuil <hans.verkuil@cisco.com> Cc: kernel-janitors@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] media: vicodec: constify v4l2_ctrl_ops structure Date: Sat, 27 Oct 2018 14:16:39 +0200 [thread overview] Message-ID: <1540642600-25840-2-git-send-email-Julia.Lawall@lip6.fr> (raw) In-Reply-To: <1540642600-25840-1-git-send-email-Julia.Lawall@lip6.fr> The v4l2_ctrl_ops structure is only stored in the ops field of a v4l2_ctrl_config structure, and this field is const, or passed as the second argument of v4l2_ctrl_new_std, and the corresponding parameter is declared as const. Accordingly, the structure can also be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- drivers/media/platform/vicodec/vicodec-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -u -p a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -1108,7 +1108,7 @@ static int vicodec_s_ctrl(struct v4l2_ct return -EINVAL; } -static struct v4l2_ctrl_ops vicodec_ctrl_ops = { +static const struct v4l2_ctrl_ops vicodec_ctrl_ops = { .s_ctrl = vicodec_s_ctrl, };
WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <Julia.Lawall@lip6.fr> To: Hans Verkuil <hans.verkuil@cisco.com> Cc: kernel-janitors@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] media: vicodec: constify v4l2_ctrl_ops structure Date: Sat, 27 Oct 2018 12:16:39 +0000 [thread overview] Message-ID: <1540642600-25840-2-git-send-email-Julia.Lawall@lip6.fr> (raw) In-Reply-To: <1540642600-25840-1-git-send-email-Julia.Lawall@lip6.fr> The v4l2_ctrl_ops structure is only stored in the ops field of a v4l2_ctrl_config structure, and this field is const, or passed as the second argument of v4l2_ctrl_new_std, and the corresponding parameter is declared as const. Accordingly, the structure can also be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- drivers/media/platform/vicodec/vicodec-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -u -p a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -1108,7 +1108,7 @@ static int vicodec_s_ctrl(struct v4l2_ct return -EINVAL; } -static struct v4l2_ctrl_ops vicodec_ctrl_ops = { +static const struct v4l2_ctrl_ops vicodec_ctrl_ops = { .s_ctrl = vicodec_s_ctrl, };
next prev parent reply other threads:[~2018-10-27 12:52 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-10-27 12:16 [PATCH 0/2] constify v4l2_ctrl_ops structures Julia Lawall 2018-10-27 12:16 ` Julia Lawall 2018-10-27 12:16 ` Julia Lawall [this message] 2018-10-27 12:16 ` [PATCH 1/2] media: vicodec: constify v4l2_ctrl_ops structure Julia Lawall 2018-10-27 12:16 ` [PATCH 2/2] media: ov5645: " Julia Lawall 2018-10-27 12:16 ` Julia Lawall
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=1540642600-25840-2-git-send-email-Julia.Lawall@lip6.fr \ --to=julia.lawall@lip6.fr \ --cc=hans.verkuil@cisco.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-media@vger.kernel.org \ --cc=mchehab@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.