[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <D02VLMHNDLXY.16ACXUWB3TWZF@gmail.com>
Date: Mon, 25 Mar 2024 14:46:58 +0100
From: "Thierry Reding" <thierry.reding@...il.com>
To: "Ricardo Ribalda" <ribalda@...omium.org>, "Jonathan Hunter"
<jonathanh@...dia.com>, "Sowjanya Komatineni" <skomatineni@...dia.com>,
"Luca Ceresoli" <luca.ceresoli@...tlin.com>, "Mauro Carvalho Chehab"
<mchehab@...nel.org>, "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Hans Verkuil" <hverkuil@...all.nl>
Cc: <linux-media@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
<linux-staging@...ts.linux.dev>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] staging: media: tegra-video: Fix
-Wmaybe-unitialized warn in gcc
On Sat Mar 23, 2024 at 11:41 AM CET, Ricardo Ribalda wrote:
> Make sure that tegra20_vi_get_input_formats always assign a value for
> yuv_input_format.
>
> Fix:
> drivers/staging/media/tegra-video/tegra20.c:624:72: warning: ‘yuv_input_format’ may be used uninitialized [-Wmaybe-uninitialized]
>
> Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
> ---
> drivers/staging/media/tegra-video/tegra20.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/media/tegra-video/tegra20.c b/drivers/staging/media/tegra-video/tegra20.c
> index c25286772603c..c39b52d0e4447 100644
> --- a/drivers/staging/media/tegra-video/tegra20.c
> +++ b/drivers/staging/media/tegra-video/tegra20.c
> @@ -176,6 +176,7 @@ static void tegra20_vi_get_input_formats(struct tegra_vi_channel *chan,
> (*yuv_input_format) = VI_INPUT_YUV_INPUT_FORMAT_YUYV;
> break;
> case MEDIA_BUS_FMT_YVYU8_2X8:
> + default:
This default seems rather arbitrary. Maybe we should follow the
tegra20_vi_get_output_formats() and default to UYVY? Also, maybe follow
the same scheme as that function (i.e. assign the default near the top
of the function rather than add a default case)?
Thierry
> (*yuv_input_format) = VI_INPUT_YUV_INPUT_FORMAT_YVYU;
> break;
> }
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists