media: rkisp1: resizer: Drop unneeded local variable
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sat, 23 Sep 2023 19:49:06 +0000 (22:49 +0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 12 Oct 2023 07:46:37 +0000 (09:46 +0200)
The sink_y local variable in rkisp1_rsz_config() stores a copy of the
sink_crop crop rectangle. Drop it, and rename sink_crop to sink_y.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c

index 8700be7d19aa81eee949d88f081d4ef39458001f..1741ada7032b1c6521e53929e0a1ae5872fd0c97 100644 (file)
@@ -271,14 +271,12 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
 {
        const struct rkisp1_rsz_yuv_mbus_info *sink_yuv_info, *src_yuv_info;
        const struct v4l2_mbus_framefmt *src_fmt, *sink_fmt;
-       const struct v4l2_rect *sink_crop;
-       struct v4l2_rect sink_y, sink_c;
+       const struct v4l2_rect *sink_y;
        struct v4l2_area src_y, src_c;
+       struct v4l2_rect sink_c;
 
        sink_fmt = v4l2_subdev_get_pad_format(&rsz->sd, sd_state,
                                              RKISP1_RSZ_PAD_SINK);
-       sink_crop = v4l2_subdev_get_pad_crop(&rsz->sd, sd_state,
-                                            RKISP1_RSZ_PAD_SINK);
        src_fmt = v4l2_subdev_get_pad_format(&rsz->sd, sd_state,
                                             RKISP1_RSZ_PAD_SRC);
 
@@ -294,14 +292,14 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
                return;
        }
 
-       sink_y.width = sink_crop->width;
-       sink_y.height = sink_crop->height;
+       sink_y = v4l2_subdev_get_pad_crop(&rsz->sd, sd_state,
+                                         RKISP1_RSZ_PAD_SINK);
+       sink_c.width = sink_y->width / sink_yuv_info->hdiv;
+       sink_c.height = sink_y->height / sink_yuv_info->vdiv;
+
        src_y.width = src_fmt->width;
        src_y.height = src_fmt->height;
 
-       sink_c.width = sink_y.width / sink_yuv_info->hdiv;
-       sink_c.height = sink_y.height / sink_yuv_info->vdiv;
-
        /*
         * The resizer is used not only to change the dimensions of the frame
         * but also to change the scale for YUV formats,
@@ -317,13 +315,13 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
        }
 
        dev_dbg(rsz->rkisp1->dev, "stream %d rsz/scale: %dx%d -> %dx%d\n",
-               rsz->id, sink_crop->width, sink_crop->height,
+               rsz->id, sink_y->width, sink_y->height,
                src_fmt->width, src_fmt->height);
        dev_dbg(rsz->rkisp1->dev, "chroma scaling %dx%d -> %dx%d\n",
                sink_c.width, sink_c.height, src_c.width, src_c.height);
 
        /* set values in the hw */
-       rkisp1_rsz_config_regs(rsz, &sink_y, &sink_c, &src_y, &src_c, when);
+       rkisp1_rsz_config_regs(rsz, sink_y, &sink_c, &src_y, &src_c, when);
 }
 
 /* ----------------------------------------------------------------------------