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: 193152 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp124055dyb; Sun, 28 Jan 2024 08:32:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEQ+Gp16+UJRrYUeyCpN3T17NyzUpL0P09/udSgebNoxnnCQSgzPZoSz8ndpnu6JGjOS8O X-Received: by 2002:a05:6a20:c18:b0:19a:78bd:7761 with SMTP id bw24-20020a056a200c1800b0019a78bd7761mr1220055pzb.102.1706459567193; Sun, 28 Jan 2024 08:32:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706459567; cv=pass; d=google.com; s=arc-20160816; b=xPbIg1zSum5E9/35fPKTk2kChS07d1QKpJHemsgf3BgpjRf8GFgOGjWSWETE1ZFkAM 2aZ47y0FgD5JhGp9if1HwH9rowMK2djtIXUggyzXgU95pIcS6uzso27OShMbDsTr1vyD vUJzXJBt1Ey6siGAYxVHTiI4M/rKu4mSB/j1+h3Rn0ZxnaCaLfHtujAUURpZNqhltwDR vcIaZh48TFf63JFkTWt0JrJfFdSqO1xHvlWBUCZfZ4fMr2kZlxtMjKA6b4O+8k6zaGe5 foPBC6vQD6u4hj0k1czFat+dXUiS+mg/sMlooaVgUwkELO3vzxgOvqaQKpl+wCtRgj4P OW7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=gyrr36Rbe8AgWubab7y8Kw9tDT0keELEe6KuPO/35LY=; fh=ljVHq+D4ZXSgLZ1bvOslChsAjmBfDd8vnPBx+pJzkLw=; b=KkhjEQJoMjBviQI374zE4KxPN+vflmiKjDk4EpNK4kgwlvSOYhgmvC4r1R0r1PEMDm yssez3g7l20KXErfq4So953kdyy+4PEoCi1IIBTe3Dj0bliEdOkINVTvBRTXJwYqnscm EbhOs++O2XvAMY/x6n/ksXH5cUpHCnaT+FAbKyrI/+IliNphYYyJGXK4+JKTu/V0+9ha pJi+FnDWarogBjUGYvoQxcHPCUJ5ENUKw9mpYL6s+lJhjFa9U0CZheAczc/AaWWVk1kf UAN98Ol7SDACpqy0z9a+iUh1ODa9axg06WkKMJuxrpLHShK7qoYfDIEMsJO9aLcn4u/h CgXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FzWuLFMx; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-41752-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41752-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i13-20020a056a00004d00b006d45aab6faasi4351132pfk.40.2024.01.28.08.32.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:32:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41752-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FzWuLFMx; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-41752-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41752-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8B32428320E for ; Sun, 28 Jan 2024 16:30:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D48C679F6; Sun, 28 Jan 2024 16:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FzWuLFMx" Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D0A6664D8 for ; Sun, 28 Jan 2024 16:14:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458447; cv=none; b=SZB7iNVTNDO9m+5meIAfNwXRCtBj25s9BJmSOEzQeNRW8umLNX8O4hmpx+7cS3qpbtFPrjcMhkjvZvKYYQF+FM1L58jFWni8fYMTVPik1FtiU5W4zjtBp5vWDAU/30bAiU7IrrvkDOi0KViZAUzGHIV/Fexqibu3snPriTKYYxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458447; c=relaxed/simple; bh=/xWOilo4Hud6QzZM3cj00D+5v080/58h43sQggsHgHg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qph3M8QqODVMnOO5+1QprWQ04ADKAGSZgq7+/s7yN6jSDkLkCpaZ0B0HU3nXuDhfmMXOa0T4K/1K89nVo9uzpbemI159WpSrtzj72WdE/9T+JR27ACNOHVjCFlOLlO2z40qrcBTMpo0IFE2xYK8b2QdlshwaHSnaUekFdLKDr2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=FzWuLFMx; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-68c3b845643so12535046d6.1 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=vger.kernel.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=FzWuLFMxaZaLG5NdsCCqSV2MCwNpFUQJkrzYErKrXyacRrj9MIM0G9DgtGnGcBKTrZ Km9+MW6IxrEpblm/gMQ0NKe9+SN+8Uh0AU5zwKL73erSXSVS1R8m9id2TihS+sbvcBk+ s8B1xvVtdglp9AHNKjfV6UujEbzsd+CzrzOfo= 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=rFFBAGE51kZCzV4jbih+hUa+7Q30T05HHNHuzEIzKY0kKeKHXLN7RDwRLkJFxYuRKO VGeJqTz7RBEn22AQM46R5KSgDJ84xF9nClUk1FStCsJ6iO0lnAJXcFCml0mpUl8Mfg63 GvmceoxiivtG69HX9Ib+AdhEyHh8SrBlLQrpPVvXevsDB28Wccj4ipRIc4FK50cKEYal s5BKTOV0sHlmLry5N2EKwpAzNvP32whZZXBLz41ckYT93KXzItQ3E38yAQDW0I2lNnDZ nTw9CeojLdNc5xLvmhFqPJAkZxt7j35fK6iRPXL7BBR6CAHnC4Hsdzc4a8c6vz/ZUZ7V LL3w== X-Gm-Message-State: AOJu0YzQqSKgIkyXAdfBSWIE7RvN3Xg1Cq+/OwHbOHjq8IOxTYOmFbZH CpRcvBGxfRuVm3F5i+Ii9i+9UJPBGJUf7Ex37Afn5kevmVjiTgK+ZnG1Onjpkw== 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789352547270786885 X-GMAIL-MSGID: 1789352547270786885 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: 193151 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp123145dyb; Sun, 28 Jan 2024 08:30:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwQIx6e/SjNKQWGNFWU/dEg23WAKrgj6GOEAU1dcuB83P4Sj2lWKCSmnsyqwG5OI11FmBP X-Received: by 2002:a05:622a:1043:b0:42a:7330:9985 with SMTP id f3-20020a05622a104300b0042a73309985mr4082703qte.11.1706459453125; Sun, 28 Jan 2024 08:30:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706459453; cv=pass; d=google.com; s=arc-20160816; b=VeusZh7cYeeAq96QdrOdQ128NpmHpc5d/ulIupIUaRoti3xmM0VvmbWtY/DFOUaWsK LGtb6gxoYItvVPCrwQuQCxQU2CLjB1c7k7xpgav0wFk/uIwWEd1BMjTc20QOAFtnpCPY lo4vuAFAMs5VDFla7X7e6FKlnhgzE+AIILvCUwdtG1Yof7khfF+onJ6Dv7uw5jtgobJi gzfO4Tqw1GEWYf8f9T1XKl76OMXdRxaBnwLhjoKAg/ppSGo1JI//gfbocQ+thidbDlgP SheYpHE13CzY1Faf9DiBBaEW74oVH2Rglm8sqC9YyFfxUzmL2qiE6C53WczoNhEVXDxy ygcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=0m/P1zm+p3BLtEev+qUE8lpx92ojld2E2PJGrd3/bdc=; fh=ljVHq+D4ZXSgLZ1bvOslChsAjmBfDd8vnPBx+pJzkLw=; b=Eoab/eA/zBMd3H+wkirhWDjna6+ugaDx2urwLBCK/QXL6XP9ttNSUglxE5+B4JgFF0 r3+3SOo8WPNeCw6g+tnMbSQ3A5WYuKiPE1qwgnJboK6OfdP1wPvMhfludJGDzOJi0UBF 9g1u1JtXC90GBiG6INj11sU1n0D0pOlgjfyWISMN2gnbDj54JB9692SAfWAEf7IbnTUd 10PTQU2D7cLCtubDfwTawr9pAU/oX87UJpGE1PJvKauJanEpkTO2AVjarZQXW5VKqVo3 4C8YZNw4/jOHrZmqkFf3RGHdNlSTamZBGWu19+yIMtK4G4aBugonzlizSuPOGGs+2h79 KWYw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DBhVCham; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-41751-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41751-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x18-20020a05622a001200b0042a83f2cb61si5039564qtw.72.2024.01.28.08.30.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:30:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41751-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DBhVCham; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-41751-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41751-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 E5B4C1C2084D for ; Sun, 28 Jan 2024 16:30:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 107A4679F3; Sun, 28 Jan 2024 16:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="DBhVCham" Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71AA6664AD for ; Sun, 28 Jan 2024 16:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458447; cv=none; b=RSUdWraqcrhYy/GO6kDL2LHjRzPG0Ilct8pMwmOoyR+RWGoSfjXXwAOx820QqCUsBI3nWjw4sJtx6cOwPt1Ey2ZezFb4yuAtVGgq50yJCow04hZX/xi2ppXawSH1wVJgzqAi2EvnXoddWgq67QyOve4chsjkMQopN6TR4fFUiL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458447; c=relaxed/simple; bh=kX1smuKrBmV0CLC0kA1GU07Ctzs/J2a31TpEn1dthpk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m4JSTubpkzKvOl/RzKXVAb8oyWXBYCetEeDZOhnW4T6JC57kbiE5pq6faWKW2FfVLSg6g37sCuFtipJLfhSaa5iHG3fuUJ53+dSfJFP2D78sV69/YQOUTEep+XWh53aoHK1Y4SJyoh7zLDUrIoJGrkGD6aVBESYH2Ufo08qb1oo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=DBhVCham; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6818a9fe380so16708626d6.2 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=vger.kernel.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=DBhVChamScDpPuZOsf1dh0dusltwcYJixkZ3rAqVSNhoD230gU3usuAhGazpLGadPu 6yH91TZAGuY26ou7sSipelcjWeBI7NsmnLTHZxUolq/5Yzgvw1mhiQGk57xSdvB/OZ2C PMhEpN4fliag772bRXuiYGxNinpm9P+BZuzOA= 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=IlYruclaMuSkBwQO781xDv0rzWhAECfWce2dww4ga1+hpZzzLx8vfF2SfGbVszzSoN Gf3uttyYwLO8CqdrIahscswB6qe7NdraPDqrpve1xNNsjkp3tFzMpp5SmNpz3SwLrSK9 dZtiwYQo3x0apSc2/ZFjtRVjvSG/LOxCpUsVRrOG1AzW3c713+7IGEJ13UmXc/Y7frfW /L1Vh5ixRCwHep8IZ2908kvEuUWVQpH8c/jOoVoLAmTycSB7AsudiWm3XdCGwbGIM2Jz KarIhg4G1+ej7WhzG0T1x8Xt86TEi1Nx2nT/rkX190GIryUz/gbeEwGD/5XgApxX7Ags BhKQ== X-Gm-Message-State: AOJu0Yx0YhHxn7me6rIn5QTqU8q+iISM8dcN6eNmWOO9qD5Ji3VW0sdS W9zMxmGiA33pc1/uvI+qNaxlFx91RSKbz6en0If6L+gWnrHkijnlVL8BXPiOniur8g2B8WvbZD7 0NA== 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789352427690870896 X-GMAIL-MSGID: 1789352427690870896 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);