mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config()
@ 2023-10-11  3:00 Moudy Ho
  2023-10-12 10:03 ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 2+ messages in thread
From: Moudy Ho @ 2023-10-11  3:00 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Matthias Brugger,
	AngeloGioacchino Del Regno, Hans Verkuil
  Cc: daoyuan huang, Ping-Hsun Wu, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek, Moudy Ho

Fix the build warnings that were detected by the linux-media
build scripts tool:

drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:
	In function 'mdp_path_config.isra':
drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:
	warning: 'ctx' may be used uninitialized [-Wmaybe-uninitialized]
      |                    out = CFG_COMP(MT8195, ctx->param, outputs[0]);
      |                                           ~~~^~~~~~~
drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h: note:
	in definition of macro 'CFG_COMP'
      |         (IS_ERR_OR_NULL(comp) ? 0 : _CFG_COMP(plat, comp, mem))
      |                         ^~~~
drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:
	note: 'ctx' was declared here
      |         struct mdp_comp_ctx *ctx;
      |

Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver")
Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
---
 drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
index 3177592490be..6adac857a477 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
@@ -261,11 +261,11 @@ static int mdp_path_config(struct mdp_dev *mdp, struct mdp_cmdq_cmd *cmd,
 		const struct v4l2_rect *compose;
 		u32 out = 0;
 
+		ctx = &path->comps[index];
 		if (CFG_CHECK(MT8183, p_id))
 			out = CFG_COMP(MT8183, ctx->param, outputs[0]);
 
 		compose = path->composes[out];
-		ctx = &path->comps[index];
 		ret = call_op(ctx, config_frame, cmd, compose);
 		if (ret)
 			return ret;
-- 
2.18.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config()
  2023-10-11  3:00 [PATCH v1] media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() Moudy Ho
@ 2023-10-12 10:03 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-10-12 10:03 UTC (permalink / raw)
  To: Moudy Ho, Mauro Carvalho Chehab, Matthias Brugger, Hans Verkuil
  Cc: daoyuan huang, Ping-Hsun Wu, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek

Il 11/10/23 05:00, Moudy Ho ha scritto:
> Fix the build warnings that were detected by the linux-media
> build scripts tool:
> 
> drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:
> 	In function 'mdp_path_config.isra':
> drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:
> 	warning: 'ctx' may be used uninitialized [-Wmaybe-uninitialized]
>        |                    out = CFG_COMP(MT8195, ctx->param, outputs[0]);
>        |                                           ~~~^~~~~~~
> drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h: note:
> 	in definition of macro 'CFG_COMP'
>        |         (IS_ERR_OR_NULL(comp) ? 0 : _CFG_COMP(plat, comp, mem))
>        |                         ^~~~
> drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:
> 	note: 'ctx' was declared here
>        |         struct mdp_comp_ctx *ctx;
>        |
> 
> Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver")
> Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-12 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-11  3:00 [PATCH v1] media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() Moudy Ho
2023-10-12 10:03 ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®