2021-01-11 14:57:57

by Ricardo Ribalda

[permalink] [raw]
Subject: [PATCH 2/9] media: mtk-mdp: Do not zero reserved fields

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: Matthias Brugger <[email protected]>
Signed-off-by: Ricardo Ribalda <[email protected]>
---
drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
index 724c7333b6e5..ace4528cdc5e 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
@@ -199,7 +199,6 @@ static const struct mtk_mdp_fmt *mtk_mdp_try_fmt_mplane(struct mtk_mdp_ctx *ctx,
pix_mp->ycbcr_enc = ctx->ycbcr_enc;
pix_mp->quantization = ctx->quant;
}
- memset(pix_mp->reserved, 0, sizeof(pix_mp->reserved));

max_w = variant->pix_max->target_rot_dis_w;
max_h = variant->pix_max->target_rot_dis_h;
@@ -247,8 +246,6 @@ static const struct mtk_mdp_fmt *mtk_mdp_try_fmt_mplane(struct mtk_mdp_ctx *ctx,
pix_mp->plane_fmt[i].bytesperline = bpl;
if (pix_mp->plane_fmt[i].sizeimage < sizeimage)
pix_mp->plane_fmt[i].sizeimage = sizeimage;
- memset(pix_mp->plane_fmt[i].reserved, 0,
- sizeof(pix_mp->plane_fmt[i].reserved));
mtk_mdp_dbg(2, "[%d] p%d, bpl:%d, sizeimage:%u (%u)", ctx->id,
i, bpl, pix_mp->plane_fmt[i].sizeimage, sizeimage);
}
--
2.30.0.284.gd98b1dd5eaa7-goog


2021-01-13 01:35:57

by Kieran Bingham

[permalink] [raw]
Subject: Re: [PATCH 2/9] media: mtk-mdp: Do not zero reserved fields

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: Matthias Brugger <[email protected]>
> Signed-off-by: Ricardo Ribalda <[email protected]>

Reviewed-by: Kieran Bingham <[email protected]>

> ---
> drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
> index 724c7333b6e5..ace4528cdc5e 100644
> --- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
> +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
> @@ -199,7 +199,6 @@ static const struct mtk_mdp_fmt *mtk_mdp_try_fmt_mplane(struct mtk_mdp_ctx *ctx,
> pix_mp->ycbcr_enc = ctx->ycbcr_enc;
> pix_mp->quantization = ctx->quant;
> }
> - memset(pix_mp->reserved, 0, sizeof(pix_mp->reserved));
>
> max_w = variant->pix_max->target_rot_dis_w;
> max_h = variant->pix_max->target_rot_dis_h;
> @@ -247,8 +246,6 @@ static const struct mtk_mdp_fmt *mtk_mdp_try_fmt_mplane(struct mtk_mdp_ctx *ctx,
> pix_mp->plane_fmt[i].bytesperline = bpl;
> if (pix_mp->plane_fmt[i].sizeimage < sizeimage)
> pix_mp->plane_fmt[i].sizeimage = sizeimage;
> - memset(pix_mp->plane_fmt[i].reserved, 0,
> - sizeof(pix_mp->plane_fmt[i].reserved));
> mtk_mdp_dbg(2, "[%d] p%d, bpl:%d, sizeimage:%u (%u)", ctx->id,
> i, bpl, pix_mp->plane_fmt[i].sizeimage, sizeimage);
> }
>