OSDN Git Service

media: staging: media: rkvdec: Constify static struct v4l2_m2m_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Tue, 12 Oct 2021 22:11:44 +0000 (00:11 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 30 Nov 2021 11:00:26 +0000 (12:00 +0100)
The only usage of rkvdec_m2m_ops is to pass its address to v4l2_m2m_init(),
which takes a pointer to const v4l2_m2m_ops as argument. Make it const
to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/rkvdec/rkvdec.c

index ad2624c..c0cf348 100644 (file)
@@ -712,7 +712,7 @@ static void rkvdec_device_run(void *priv)
                rkvdec_job_finish(ctx, VB2_BUF_STATE_ERROR);
 }
 
-static struct v4l2_m2m_ops rkvdec_m2m_ops = {
+static const struct v4l2_m2m_ops rkvdec_m2m_ops = {
        .device_run = rkvdec_device_run,
 };