public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] media: nxp: imx8-isi: Factor out a variable
Date: Sun, 28 Jan 2024 19:13:32 +0200	[thread overview]
Message-ID: <20240128171332.GD27180@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20240128-gcc-11-warnings-v1-1-52bbdf492049@chromium.org>

Hi Ricardo,

Thank you for the patch.

On Sun, Jan 28, 2024 at 04:13:56PM +0000, Ricardo Ribalda wrote:
> gcc-11 seems to believe that coffs can be used uninitialized. Refactor

s/coffs/coeffs/

> the code and remove the csen variable to convince gcc that we are doing

s/csen/cscen/

> a good job.
> 
> drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c:218:20: warning: 'coeffs' may be used uninitialized in this function [-Wmaybe-uninitialized]
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
> index 19e80b95ffea..5623914f95e6 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
> @@ -215,8 +215,7 @@ static void mxc_isi_channel_set_csc(struct mxc_isi_pipe *pipe,
>  		[MXC_ISI_ENC_RGB] = "RGB",
>  		[MXC_ISI_ENC_YUV] = "YUV",
>  	};
> -	const u32 *coeffs;
> -	bool cscen = true;
> +	const u32 *coeffs = NULL;
>  	u32 val;
>  
>  	val = mxc_isi_read(pipe, CHNL_IMG_CTRL);
> @@ -235,14 +234,13 @@ static void mxc_isi_channel_set_csc(struct mxc_isi_pipe *pipe,
>  		val |= CHNL_IMG_CTRL_CSC_MODE(CHNL_IMG_CTRL_CSC_MODE_RGB2YCBCR);
>  	} else {
>  		/* Bypass CSC */
> -		cscen = false;
>  		val |= CHNL_IMG_CTRL_CSC_BYPASS;
>  	}
>  
>  	dev_dbg(pipe->isi->dev, "CSC: %s -> %s\n",
>  		encodings[in_encoding], encodings[out_encoding]);
>  
> -	if (cscen) {
> +	if (coeffs) {
>  		mxc_isi_write(pipe, CHNL_CSC_COEFF0, coeffs[0]);
>  		mxc_isi_write(pipe, CHNL_CSC_COEFF1, coeffs[1]);
>  		mxc_isi_write(pipe, CHNL_CSC_COEFF2, coeffs[2]);
> @@ -253,7 +251,7 @@ static void mxc_isi_channel_set_csc(struct mxc_isi_pipe *pipe,
>  
>  	mxc_isi_write(pipe, CHNL_IMG_CTRL, val);
>  
> -	*bypass = !cscen;
> +	*bypass = !coeffs;
>  }
>  
>  void mxc_isi_channel_set_alpha(struct mxc_isi_pipe *pipe, u8 alpha)
> 

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-01-28 17:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-28 16:13 [PATCH 0/2] media: Fix build warnings with gcc-11 Ricardo Ribalda
2024-01-28 16:13 ` [PATCH 1/2] media: nxp: imx8-isi: Factor out a variable Ricardo Ribalda
2024-01-28 17:13   ` Laurent Pinchart [this message]
2024-01-28 16:13 ` [PATCH 2/2] media: usb: s2255: Refactor s2255_get_fx2fw Ricardo Ribalda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240128171332.GD27180@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox