From patchwork Sun Jan 28 16:13:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13534524 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1862C47258 for ; Sun, 28 Jan 2024 16:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YGUyhLT807y44Oj50kEEk57crV7DddUTOQQxScg4ipI=; b=Y999svMZLji9dJ mhbvmvGlyXSra+DWG9e7VhmiYnNLfS7nXS4rsZvkwmgih7MpUoLrYpSWMDGgAANZ1Vik9xtDjIhK/ DsezdPsIUPRjxaVsRPTXU29f4bHLM4UJXL3fhrs42EvwW2sRTxnB7T8DfFRg8iv04Bx8D/cOW3Y33 a7e/FuM60nNxwCVLanbQxCwwMnt2q1NuigxiHi7g9/o8xlFM1ddADrZVYKm8zj+Es+73fSq4FLXKJ 4GGY785muMlxYv5dexvvYDvSJLkb+2PybkHtcsxFcWzFfHP+M2BHYYM08+0rsjGEzlqHs8a8VEL39 wb7LZoGt3Nu+r70TdZMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rU7nN-00000009qIt-13LU; Sun, 28 Jan 2024 16:14:09 +0000 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rU7nI-00000009qFL-3Uqa for linux-arm-kernel@lists.infradead.org; Sun, 28 Jan 2024 16:14:06 +0000 Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-686b389b5d6so19971476d6.0 for ; Sun, 28 Jan 2024 08:14:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706458443; x=1707063243; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gyrr36Rbe8AgWubab7y8Kw9tDT0keELEe6KuPO/35LY=; b=hg2K8v/EAKRr8EG1e4lVgMSRKZIya3ePGllwHsUnrEIJBfmMIrVN1jOHXrFobL8J0U uoDPNsEcdhm6P290CAgL0mLWkyEQXPXYsbgiWTzvD+QJHRi8YsTDAXI+jMeuinFi2cTX snPrcpX1i8l9ebQnCPb9Pz7hcwa71ol1xVHlE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706458443; x=1707063243; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gyrr36Rbe8AgWubab7y8Kw9tDT0keELEe6KuPO/35LY=; b=R9Ut6bW4KrrT8xpCUTH3wqVjTgZsAl/uKFf4tf70elA4O8WDYAvt0xeDDA9V1sUFTJ 9gu44mxfLq/pSDYl2evPjPV5uYp8fx98l03iA8ePoPonhLc39NtXBB2ZB+U01nBH26rH nFghVk/VHx98EhBohnpeRdXSoDAoD0j3PzdkkME1ZnUDteDFHRqFyPj/R+EI8BqvCJfc vrmb5Qp6qz3v9u91pD76C90mNdkcqkWgi7l9i7/RtyI6VNLyYw5pbR/amVkbetVVu+MW Ow5WKCiojr2H4wOI/nh8hML9CQo45YQ2PMNY1S3t4UudKPhoxqQSxPApAJyCpDHLHeHD +Acg== X-Gm-Message-State: AOJu0Yzurv2ZhNXJXYosAY3gacHK3EOq2qRifFT26YCpiz0ETgrWwnjG POQQztT4/Z7gdRp5aqCmY/Q7Kg7oEZcqR/2sIXTu45mQwjUSDrJnJKkmk8+YNA== X-Google-Smtp-Source: AGHT+IEi91bgjGpdxd6b1KVJteAO32/e7rfk2MgI0un8dbL/yrThhpzpxRXTFzO5dYTWX+Rat0dJbg== X-Received: by 2002:a05:6214:2483:b0:68c:46ab:c8df with SMTP id gi3-20020a056214248300b0068c46abc8dfmr1995323qvb.128.1706458443430; Sun, 28 Jan 2024 08:14:03 -0800 (PST) Received: from denia.c.googlers.com (240.157.150.34.bc.googleusercontent.com. [34.150.157.240]) by smtp.gmail.com with ESMTPSA id dz11-20020ad4588b000000b0068c493426edsm566640qvb.104.2024.01.28.08.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:14:03 -0800 (PST) From: Ricardo Ribalda Date: Sun, 28 Jan 2024 16:13:56 +0000 Subject: [PATCH 1/2] media: nxp: imx8-isi: Factor out a variable MIME-Version: 1.0 Message-Id: <20240128-gcc-11-warnings-v1-1-52bbdf492049@chromium.org> References: <20240128-gcc-11-warnings-v1-0-52bbdf492049@chromium.org> In-Reply-To: <20240128-gcc-11-warnings-v1-0-52bbdf492049@chromium.org> To: Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240128_081405_125700_71740490 X-CRM114-Status: GOOD ( 13.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org gcc-11 seems to believe that coffs can be used uninitialized. Refactor the code and remove the csen variable to convince gcc that we are doing 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)