media: s5p-jpeg: Constify struct v4l2_m2m_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Tue, 30 Nov 2021 21:27:00 +0000 (22:27 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 7 Dec 2021 10:29:56 +0000 (11:29 +0100)
The only usage of the v4l2_m2m_ops structs is to pass their address to
v4l2_m2m_init() which takes a pointer to const struct v4l2_m2m_ops as
argument. Make them const to allow the compiler to put them in read-only
memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/s5p-jpeg/jpeg-core.c
drivers/media/platform/s5p-jpeg/jpeg-core.h

index ebdfd24e9cd53eca05dff400a4fd2362a401dfa3..a8d9159d5ed8736c400f4d4685d46507db883678 100644 (file)
@@ -2425,17 +2425,17 @@ static int s5p_jpeg_job_ready(void *priv)
        return 1;
 }
 
-static struct v4l2_m2m_ops s5p_jpeg_m2m_ops = {
+static const struct v4l2_m2m_ops s5p_jpeg_m2m_ops = {
        .device_run     = s5p_jpeg_device_run,
        .job_ready      = s5p_jpeg_job_ready,
 };
 
-static struct v4l2_m2m_ops exynos3250_jpeg_m2m_ops = {
+static const struct v4l2_m2m_ops exynos3250_jpeg_m2m_ops = {
        .device_run     = exynos3250_jpeg_device_run,
        .job_ready      = s5p_jpeg_job_ready,
 };
 
-static struct v4l2_m2m_ops exynos4_jpeg_m2m_ops = {
+static const struct v4l2_m2m_ops exynos4_jpeg_m2m_ops = {
        .device_run     = exynos4_jpeg_device_run,
        .job_ready      = s5p_jpeg_job_ready,
 };
index 8473a019bb5f276624af2540129d5a2016b2f900..4a5fb1b154559a31ec2bbb37f5e630b5dea73125 100644 (file)
@@ -142,7 +142,7 @@ struct s5p_jpeg_variant {
        unsigned int            hw3250_compat:1;
        unsigned int            htbl_reinit:1;
        unsigned int            hw_ex4_compat:1;
-       struct v4l2_m2m_ops     *m2m_ops;
+       const struct v4l2_m2m_ops *m2m_ops;
        irqreturn_t             (*jpeg_irq)(int irq, void *priv);
        const char              *clk_names[JPEG_MAX_CLOCKS];
        int                     num_clocks;