diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-21 09:43:01 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-11 17:58:45 +0200 |
commit | 370f6e5aaa22969db3e96a43e2e718b978a1b5c9 (patch) | |
tree | 45bb2e667c159da7089ae694d9aa227be0d26fb5 | |
parent | aaebb6547610e7c739507e389296eb36aacc7908 (diff) |
media: atomisp: avoid a copy of v4l2_mbus_framefmt at stack
There's no reason to copy isp_sink_fmt, as the driver
uses it for read-only purposes.
Linux stack is a precious resource. Let's avoid wasting it.
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_cmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 1e22cb70ac1b..f5fa9fe46659 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -5608,7 +5608,7 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) unsigned int dvs_env_w = 0, dvs_env_h = 0; unsigned int padding_w = pad_w, padding_h = pad_h; bool res_overflow = false, crop_needs_override = false; - struct v4l2_mbus_framefmt isp_sink_fmt; + struct v4l2_mbus_framefmt *isp_sink_fmt; struct v4l2_mbus_framefmt isp_source_fmt = {0}; struct v4l2_rect isp_sink_crop; u16 source_pad = atomisp_subdev_source_pad(vdev); @@ -5789,7 +5789,7 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) ATOMISP_SUBDEV_PAD_SINK)->code = snr_format_bridge->mbus_code; - isp_sink_fmt = *atomisp_subdev_get_ffmt(&asd->subdev, NULL, + isp_sink_fmt = atomisp_subdev_get_ffmt(&asd->subdev, NULL, V4L2_SUBDEV_FORMAT_ACTIVE, ATOMISP_SUBDEV_PAD_SINK); @@ -5847,9 +5847,9 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) * capture pipe and usually has lower resolution than capture pipe. */ if (!asd->continuous_mode->val || - isp_sink_fmt.width < (f->fmt.pix.width + padding_w + dvs_env_w) || - isp_sink_fmt.height < (f->fmt.pix.height + padding_h + - dvs_env_h)) { + isp_sink_fmt->width < (f->fmt.pix.width + padding_w + dvs_env_w) || + isp_sink_fmt->height < (f->fmt.pix.height + padding_h + + dvs_env_h)) { /* * For jpeg or custom raw format the sensor will return constant * width and height. Because we already had quried try_mbus_fmt, |