media: imx: utils: Constify some mbus and ipu_image arguments
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 6 Apr 2020 16:39:05 +0000 (18:39 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 21 Apr 2020 11:23:29 +0000 (13:23 +0200)
The imx_media_mbus_fmt_to_pix_fmt() and imx_media_mbus_fmt_to_ipu_image()
functions do not need to modify their mbus argument, and
imx_media_ipu_image_to_mbus_fmt() does not need to modify its ipu_image
argument. Make them const.

[slongerbeam@gmail.com: Constified mbus arg to
 imx_media_mbus_fmt_to_ipu_image(), and ipu_image
 arg to imx_media_ipu_image_to_mbus_fmt(), as well]

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/imx/imx-media-utils.c
drivers/staging/media/imx/imx-media.h

index 85ddea05997ab94fc9bdd4421e6dfce83d1b4ced..42e64b618a61f0c06101462e7b52b98c563a4de3 100644 (file)
@@ -497,7 +497,7 @@ void imx_media_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt,
 EXPORT_SYMBOL_GPL(imx_media_try_colorimetry);
 
 int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix,
-                                 struct v4l2_mbus_framefmt *mbus,
+                                 const struct v4l2_mbus_framefmt *mbus,
                                  const struct imx_media_pixfmt *cc)
 {
        u32 width;
@@ -550,7 +550,7 @@ int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix,
 EXPORT_SYMBOL_GPL(imx_media_mbus_fmt_to_pix_fmt);
 
 int imx_media_mbus_fmt_to_ipu_image(struct ipu_image *image,
-                                   struct v4l2_mbus_framefmt *mbus)
+                                   const struct v4l2_mbus_framefmt *mbus)
 {
        int ret;
 
@@ -568,7 +568,7 @@ int imx_media_mbus_fmt_to_ipu_image(struct ipu_image *image,
 EXPORT_SYMBOL_GPL(imx_media_mbus_fmt_to_ipu_image);
 
 int imx_media_ipu_image_to_mbus_fmt(struct v4l2_mbus_framefmt *mbus,
-                                   struct ipu_image *image)
+                                   const struct ipu_image *image)
 {
        const struct imx_media_pixfmt *fmt;
 
index 03467f6397c34aa5efeed563e3c39da43d099d82..ca36beca16deb3619b87e6eae3a9c692cffb0fde 100644 (file)
@@ -194,12 +194,12 @@ int imx_media_init_cfg(struct v4l2_subdev *sd,
 void imx_media_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt,
                               bool ic_route);
 int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix,
-                                 struct v4l2_mbus_framefmt *mbus,
+                                 const struct v4l2_mbus_framefmt *mbus,
                                  const struct imx_media_pixfmt *cc);
 int imx_media_mbus_fmt_to_ipu_image(struct ipu_image *image,
-                                   struct v4l2_mbus_framefmt *mbus);
+                                   const struct v4l2_mbus_framefmt *mbus);
 int imx_media_ipu_image_to_mbus_fmt(struct v4l2_mbus_framefmt *mbus,
-                                   struct ipu_image *image);
+                                   const struct ipu_image *image);
 void imx_media_grp_id_to_sd_name(char *sd_name, int sz,
                                 u32 grp_id, int ipu_id);
 struct v4l2_subdev *