Message ID | 20220614191127.3420492-36-paul.elder@ideasonboard.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | media: rkisp1: Cleanups and add support for i.MX8MP | expand |
On 15.06.2022 04:11, Paul Elder wrote: >From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > >A set of local variables point to structure that are not meant to be >modified. Constify them. > >Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by Dafna Hirschfeld <dafna@fastmail.com> >--- > drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c >index 86d496855374..91b37f2dca91 100644 >--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c >+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c >@@ -113,7 +113,7 @@ rkisp1_isp_get_pad_crop(struct rkisp1_isp *isp, > */ > static void rkisp1_config_ism(struct rkisp1_isp *isp) > { >- struct v4l2_rect *src_crop = >+ const struct v4l2_rect *src_crop = > rkisp1_isp_get_pad_crop(isp, NULL, > RKISP1_ISP_PAD_SOURCE_VIDEO, > V4L2_SUBDEV_FORMAT_ACTIVE); >@@ -146,8 +146,8 @@ static int rkisp1_config_isp(struct rkisp1_isp *isp, > u32 isp_ctrl = 0, irq_mask = 0, acq_mult = 0, acq_prop = 0; > const struct rkisp1_mbus_info *sink_fmt = isp->sink_fmt; > const struct rkisp1_mbus_info *src_fmt = isp->src_fmt; >- struct v4l2_mbus_framefmt *sink_frm; >- struct v4l2_rect *sink_crop; >+ const struct v4l2_mbus_framefmt *sink_frm; >+ const struct v4l2_rect *sink_crop; > > sink_frm = rkisp1_isp_get_pad_fmt(isp, NULL, > RKISP1_ISP_PAD_SINK_VIDEO, >@@ -557,7 +557,7 @@ static void rkisp1_isp_set_sink_crop(struct rkisp1_isp *isp, > struct v4l2_rect *r, unsigned int which) > { > struct v4l2_rect *sink_crop, *src_crop; >- struct v4l2_mbus_framefmt *sink_fmt; >+ const struct v4l2_mbus_framefmt *sink_fmt; > > sink_crop = rkisp1_isp_get_pad_crop(isp, sd_state, > RKISP1_ISP_PAD_SINK_VIDEO, >@@ -742,7 +742,7 @@ static int rkisp1_isp_s_stream(struct v4l2_subdev *sd, int enable) > { > struct rkisp1_isp *isp = to_rkisp1_isp(sd); > struct rkisp1_device *rkisp1 = isp->rkisp1; >- struct rkisp1_sensor_async *asd; >+ const struct rkisp1_sensor_async *asd; > int ret; > > if (!enable) { >-- >2.30.2 >
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c index 86d496855374..91b37f2dca91 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c @@ -113,7 +113,7 @@ rkisp1_isp_get_pad_crop(struct rkisp1_isp *isp, */ static void rkisp1_config_ism(struct rkisp1_isp *isp) { - struct v4l2_rect *src_crop = + const struct v4l2_rect *src_crop = rkisp1_isp_get_pad_crop(isp, NULL, RKISP1_ISP_PAD_SOURCE_VIDEO, V4L2_SUBDEV_FORMAT_ACTIVE); @@ -146,8 +146,8 @@ static int rkisp1_config_isp(struct rkisp1_isp *isp, u32 isp_ctrl = 0, irq_mask = 0, acq_mult = 0, acq_prop = 0; const struct rkisp1_mbus_info *sink_fmt = isp->sink_fmt; const struct rkisp1_mbus_info *src_fmt = isp->src_fmt; - struct v4l2_mbus_framefmt *sink_frm; - struct v4l2_rect *sink_crop; + const struct v4l2_mbus_framefmt *sink_frm; + const struct v4l2_rect *sink_crop; sink_frm = rkisp1_isp_get_pad_fmt(isp, NULL, RKISP1_ISP_PAD_SINK_VIDEO, @@ -557,7 +557,7 @@ static void rkisp1_isp_set_sink_crop(struct rkisp1_isp *isp, struct v4l2_rect *r, unsigned int which) { struct v4l2_rect *sink_crop, *src_crop; - struct v4l2_mbus_framefmt *sink_fmt; + const struct v4l2_mbus_framefmt *sink_fmt; sink_crop = rkisp1_isp_get_pad_crop(isp, sd_state, RKISP1_ISP_PAD_SINK_VIDEO, @@ -742,7 +742,7 @@ static int rkisp1_isp_s_stream(struct v4l2_subdev *sd, int enable) { struct rkisp1_isp *isp = to_rkisp1_isp(sd); struct rkisp1_device *rkisp1 = isp->rkisp1; - struct rkisp1_sensor_async *asd; + const struct rkisp1_sensor_async *asd; int ret; if (!enable) {