diff mbox series

[1/9] media: ipu3-cio2: Do not zero reserved fields

Message ID 20210111145445.28854-1-ribalda@chromium.org (mailing list archive)
State New, archived
Headers show
Series [1/9] media: ipu3-cio2: Do not zero reserved fields | expand

Commit Message

Ricardo Ribalda Jan. 11, 2021, 2:54 p.m. UTC
Core code already clears reserved fields of struct
v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero
v4l2_plane_pix_format reserved fields").

Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/pci/intel/ipu3/ipu3-cio2.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Kieran Bingham Jan. 12, 2021, 11:58 a.m. UTC | #1
Hi Ricardo,

On 11/01/2021 14:54, Ricardo Ribalda wrote:
> Core code already clears reserved fields of struct
> v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero
> v4l2_plane_pix_format reserved fields").
> 
> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> ---
>  drivers/media/pci/intel/ipu3/ipu3-cio2.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
> index 36e354ecf71e..c5376de8cb8a 100644
> --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
> +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
> @@ -1094,12 +1094,9 @@ static int cio2_v4l2_try_fmt(struct file *file, void *fh, struct v4l2_format *f)
>  	mpix->pixelformat = fmt->fourcc;
>  	mpix->colorspace = V4L2_COLORSPACE_RAW;
>  	mpix->field = V4L2_FIELD_NONE;
> -	memset(mpix->reserved, 0, sizeof(mpix->reserved));
>  	mpix->plane_fmt[0].bytesperline = cio2_bytesperline(mpix->width);
>  	mpix->plane_fmt[0].sizeimage = mpix->plane_fmt[0].bytesperline *
>  							mpix->height;
> -	memset(mpix->plane_fmt[0].reserved, 0,
> -	       sizeof(mpix->plane_fmt[0].reserved));
>  
>  	/* use default */
>  	mpix->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
>
diff mbox series

Patch

diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index 36e354ecf71e..c5376de8cb8a 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -1094,12 +1094,9 @@  static int cio2_v4l2_try_fmt(struct file *file, void *fh, struct v4l2_format *f)
 	mpix->pixelformat = fmt->fourcc;
 	mpix->colorspace = V4L2_COLORSPACE_RAW;
 	mpix->field = V4L2_FIELD_NONE;
-	memset(mpix->reserved, 0, sizeof(mpix->reserved));
 	mpix->plane_fmt[0].bytesperline = cio2_bytesperline(mpix->width);
 	mpix->plane_fmt[0].sizeimage = mpix->plane_fmt[0].bytesperline *
 							mpix->height;
-	memset(mpix->plane_fmt[0].reserved, 0,
-	       sizeof(mpix->plane_fmt[0].reserved));
 
 	/* use default */
 	mpix->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;