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) From patchwork Sun Jan 28 16:13:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13534526 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 99228C47DA9 for ; Sun, 28 Jan 2024 16:14:21 +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=F9+PWn8Lr8rT2cHAiqXDssm6ih3uMcLDs343F2b/HUc=; b=XPCxDI4mHOoIxw 7/BrLx7xYufcwkGBYBSG5j5daic33RiZKLmoruXrb+62VUZ7x/itTwtBbncOrYT3RijRNWUUVI5Ja DLZFDE9HgFef9ArzXF++5gn1NuZV3Vqi1OUCFzZdO8NBkUifEl9aUiFKB4aqC464tHVlPN09Bf3Qs kRrouklBn6fDnkKLtdTXPZAHQ/+OjYm+CNEdtpBHnB7Nxt8a4fdBF9tuLtT64FH5HZpGh45+cSJ+O zKWz3TDXGmb6Msiep5lhBEbUy4MiCcMWN6bUULIA9NXM45zI5gIlP4llXdKaI41UvgNEkkRDeEl/T lHpztebgeVskBUor+Lcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rU7nO-00000009qJw-2d85; Sun, 28 Jan 2024 16:14:10 +0000 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rU7nJ-00000009qFz-3CYe for linux-arm-kernel@lists.infradead.org; Sun, 28 Jan 2024 16:14:07 +0000 Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-686a92a8661so16249366d6.0 for ; Sun, 28 Jan 2024 08:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706458444; x=1707063244; 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=0m/P1zm+p3BLtEev+qUE8lpx92ojld2E2PJGrd3/bdc=; b=Odqqp/JO3kJ7nVZIaODaSyG0/BdsPZZTXb2Zvw4XKudLmVPxg5j0wlBdIY2vsvzy6M wHR4ifMTD8X5sKpr/N/Z9kun7zjbCeJ7JPRPtDKsjSGuQw02KOaW7WnKNT888nn6ayaA BcVDkVQnikKqoO2G1FEqu/Adbr4rV5fNVzerk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706458444; x=1707063244; 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=0m/P1zm+p3BLtEev+qUE8lpx92ojld2E2PJGrd3/bdc=; b=j7rX9OzieHDM6c5gP4eEOuQL1ajmAc62ksq3EIdS415It2y1YDrVoPnIRDx4txQgZf zlH42WHWs4mY/FJSeLZHdeq4r7vXTKie0rQnqZmxIN4iGtDbZTDqvzfwVpc1LwEYproT g4WSvLrA5chIJ2XhBDiEQTEqaZYgzJAEK67Rn/6Oy6lP54k6SYQtB7j0KiIAW/1ImL8Z 3EmTzrMvvpMNy8NTr4z+P4EGnBMyHkDcSg25J8X0e7uqDlHlVGuzOQCZJRKbFSMhpf3/ qMWYU85w2v6WcbvUJT9OgAtXc2P3j5lYAXCs0b/9I0nP+jrKJx56Hz7yVVSJnwxDYZxi u//Q== X-Gm-Message-State: AOJu0YxaifSmvcWsJLz7MSrfn+P1yYPpMympPY9p64BbCB+F/1MMIjef SKgGzLGprhPCsX+E09H28wcLIUiW2YnUIhY58QyFMOMpPpEEuTh3VrcgNcScew== X-Google-Smtp-Source: AGHT+IFpFnYrtsvv/PZSGrHMTLLAsQo9nx3jvGx+Qy0aib/OUFMOdMy+oEDsUYYR6HbDZ0N/K9VkLw== X-Received: by 2002:a05:6214:e88:b0:685:5639:fb1a with SMTP id hf8-20020a0562140e8800b006855639fb1amr5171396qvb.102.1706458444437; Sun, 28 Jan 2024 08:14:04 -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.03 (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:57 +0000 Subject: [PATCH 2/2] media: usb: s2255: Refactor s2255_get_fx2fw MIME-Version: 1.0 Message-Id: <20240128-gcc-11-warnings-v1-2-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_892094_E9C37AF5 X-CRM114-Status: GOOD ( 11.44 ) 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 Resize the buffer to the actual size needed and initialize it. With this we can convince gcc-11 that the variable is not used uninitialized. drivers/media/usb/s2255/s2255drv.c:1914:25: warning: 'transBuffer' may be used uninitialized [-Wmaybe-uninitialized] Signed-off-by: Ricardo Ribalda --- drivers/media/usb/s2255/s2255drv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index 3c2627712fe9..8e1de1e8bd12 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -1906,9 +1906,10 @@ static int s2255_get_fx2fw(struct s2255_dev *dev) { int fw; int ret; - unsigned char transBuffer[64]; - ret = s2255_vendor_req(dev, S2255_VR_FW, 0, 0, transBuffer, 2, - S2255_VR_IN); + u8 transBuffer[2] = {}; + + ret = s2255_vendor_req(dev, S2255_VR_FW, 0, 0, transBuffer, + sizeof(transBuffer), S2255_VR_IN); if (ret < 0) dprintk(dev, 2, "get fw error: %x\n", ret); fw = transBuffer[0] + (transBuffer[1] << 8);