Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp795284rdb; Sun, 28 Jan 2024 09:13:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFg0kl1ifyHwlieLPyLHX9JOjiRg53LGQHaZP8YURurLFlXk7ig8nYCnBWcmIBh1hOfW+Nb X-Received: by 2002:a05:622a:2c9:b0:42a:2e4d:f8ba with SMTP id a9-20020a05622a02c900b0042a2e4df8bamr4158629qtx.15.1706462027116; Sun, 28 Jan 2024 09:13:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706462027; cv=pass; d=google.com; s=arc-20160816; b=iRmOq8ZCG1SkGvCNPgwCUNzHlYzpeI1yYNTdr9CLni5NMdp2wUU7pqboYfJVP0c0ql O3mx7r7vS4UKZucv/uHznX3IYmERafbdnXF+d6X3CBjy4l7NPGfeRaAIHzzFls5XImAz QqZjwWmQZFc/mrBTrzoGa+A7te3y9ztRXW2MPuePuTbmC+LzaG43sRXo38amRUmieJbR gA/Aqu5Vz+UpG3SovkPInI3CgqTRJNqnxlZEwScknsmfwm/Yd/jDzbFubaK8gwxMxt9n 51pX4QCQOHXTHxyoPZq8LB39mfOX33+BdsiwOWZiEQm+Rl70y+hX+z+fpWRAghzaIN+x 34BA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3aypi/Rmif6ke+DlrhU7usyf1W7at6CnJJhV3dQ5VIo=; fh=mgzgf0sv9kH1gcCGGVwg7VsMZ5Efwnz2dHcGHYvQzvM=; b=dxqQ6jdfVXuLjYVQ/MGeP4uaHSM8855VgpqX3ia835IHLvM+yapnBbwfKo0nhcw81v XolA/9zgE2DevpRZWRg+3U4zwIiqwxeyRDSnZMbZe9wNyNIaTyqZxshY+heRmmbuzoMw HGFFAhVtGJFkpFUKkrp/3zVOpLSNvU6fyu2XEg3KW341iWsZHW7RseAPIIpDR4CPsFKv KwMu/ewImEyJB0boq/whG2RhW2x5MNNo6r62QR4EjDR4XN6kxmXSuaZ5ppsI4fWxe1ml b0ymOP+JDidUx3FvaEbL9FVxqAAMfSpVhsGaUIGBRNgx4Y5uHV0euKK/Z4//uj+vo6cs GbJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=AwYolSO+; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-41842-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41842-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k6-20020ac85fc6000000b0042a8b3f7a47si3755516qta.683.2024.01.28.09.13.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 09:13:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41842-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=AwYolSO+; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-41842-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41842-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B847E1C217ED for ; Sun, 28 Jan 2024 17:13:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92FDE2D602; Sun, 28 Jan 2024 17:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="AwYolSO+" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36DC92E630; Sun, 28 Jan 2024 17:13:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706462018; cv=none; b=CWLa0YizpOqUFS9gzcQV5vwJVJRydTpsHjcrDhBLZw8SKMsi4ry44fGqHRLfm04H0iHT4zK8BWYo44/GMwjc114AA65KhbqRZZ/xZtisWM/lFeYtY4XE51Pmimdt24BD1Bs6nGRNynY1arnmH3lAaYnu2xFlQfMq9ZJqiLymVSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706462018; c=relaxed/simple; bh=nf6DRFxx7i1k82b+O6czyuhfZJjgaHz50J21iXl04R4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JxSWT5ikLkCeWvan3hSz/LTu9ZWyJtK6fAg/Z+wRf9DIWmoF9qazpBklI/cfz4zOeM1g+gF1AseD2pQeFOM+TbZOmPHwHEAuc4TwQrGil/Evk4kQaGlrb+qSEngREXSI0D0zmcp5G5PB94ohNDi2RL4045HEhZXc4xvpNJ7zWO4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=AwYolSO+; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E95273D9; Sun, 28 Jan 2024 18:12:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1706461937; bh=nf6DRFxx7i1k82b+O6czyuhfZJjgaHz50J21iXl04R4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AwYolSO+Mi3f4nlRgOjNAL2mAIlNAWKLrUUaW5xbI7gKBsNEBVdEjpED1ce15Q2c2 6mbvtLS9uj2pRmXXTFbrfvzl/t+l3OgSyqNbAjXJvCB2Ziek7m3RgPPN4pu/lO1p3i a92h0QgKGyDuVPs+DgN5a61EBDI8H2TZmVWIst+U= Date: Sun, 28 Jan 2024 19:13:32 +0200 From: Laurent Pinchart To: Ricardo Ribalda Cc: Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , 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 Message-ID: <20240128171332.GD27180@pendragon.ideasonboard.com> References: <20240128-gcc-11-warnings-v1-0-52bbdf492049@chromium.org> <20240128-gcc-11-warnings-v1-1-52bbdf492049@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Reviewed-by: Laurent Pinchart > --- > 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