diff mbox series

[8/9] media: vicodec: Do not zero reserved fields

Message ID 20210111145445.28854-9-ribalda@chromium.org
State Accepted
Commit ed2fb2f57430dfb030aaecd92bced752d999dd2f
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/test-drivers/vicodec/vicodec-core.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Kieran Bingham Jan. 12, 2021, 11:44 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: Hans Verkuil <hverkuil-cisco@xs4all.nl>

> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>


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



> ---

>  drivers/media/test-drivers/vicodec/vicodec-core.c | 5 -----

>  1 file changed, 5 deletions(-)

> 

> diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c

> index 025f3ff77302..33f1c893c1b6 100644

> --- a/drivers/media/test-drivers/vicodec/vicodec-core.c

> +++ b/drivers/media/test-drivers/vicodec/vicodec-core.c

> @@ -811,9 +811,6 @@ static int vidioc_g_fmt(struct vicodec_ctx *ctx, struct v4l2_format *f)

>  		pix_mp->xfer_func = ctx->state.xfer_func;

>  		pix_mp->ycbcr_enc = ctx->state.ycbcr_enc;

>  		pix_mp->quantization = ctx->state.quantization;

> -		memset(pix_mp->reserved, 0, sizeof(pix_mp->reserved));

> -		memset(pix_mp->plane_fmt[0].reserved, 0,

> -		       sizeof(pix_mp->plane_fmt[0].reserved));

>  		break;

>  	default:

>  		return -EINVAL;

> @@ -886,8 +883,6 @@ static int vidioc_try_fmt(struct vicodec_ctx *ctx, struct v4l2_format *f)

>  			info->sizeimage_mult / info->sizeimage_div;

>  		if (pix_mp->pixelformat == V4L2_PIX_FMT_FWHT)

>  			plane->sizeimage += sizeof(struct fwht_cframe_hdr);

> -		memset(pix_mp->reserved, 0, sizeof(pix_mp->reserved));

> -		memset(plane->reserved, 0, sizeof(plane->reserved));

>  		break;

>  	default:

>  		return -EINVAL;

>
diff mbox series

Patch

diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c
index 025f3ff77302..33f1c893c1b6 100644
--- a/drivers/media/test-drivers/vicodec/vicodec-core.c
+++ b/drivers/media/test-drivers/vicodec/vicodec-core.c
@@ -811,9 +811,6 @@  static int vidioc_g_fmt(struct vicodec_ctx *ctx, struct v4l2_format *f)
 		pix_mp->xfer_func = ctx->state.xfer_func;
 		pix_mp->ycbcr_enc = ctx->state.ycbcr_enc;
 		pix_mp->quantization = ctx->state.quantization;
-		memset(pix_mp->reserved, 0, sizeof(pix_mp->reserved));
-		memset(pix_mp->plane_fmt[0].reserved, 0,
-		       sizeof(pix_mp->plane_fmt[0].reserved));
 		break;
 	default:
 		return -EINVAL;
@@ -886,8 +883,6 @@  static int vidioc_try_fmt(struct vicodec_ctx *ctx, struct v4l2_format *f)
 			info->sizeimage_mult / info->sizeimage_div;
 		if (pix_mp->pixelformat == V4L2_PIX_FMT_FWHT)
 			plane->sizeimage += sizeof(struct fwht_cframe_hdr);
-		memset(pix_mp->reserved, 0, sizeof(pix_mp->reserved));
-		memset(plane->reserved, 0, sizeof(plane->reserved));
 		break;
 	default:
 		return -EINVAL;