Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1914343lqb; Mon, 27 May 2024 01:25:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJ+dg853oIO0G8hKVI1qinLMsOvOjtIDG4z70AnoZ1DnrUmZgJwCrYCdcJu0bN/+xNAwExkE/PK0xempLVtsuTchGhzh+4aWPNNk9yOg== X-Google-Smtp-Source: AGHT+IELJtC6FIQ1LBCe2/KzELFjfeogpF1Yv5OPNEgMfq+L5lhTrqQGKIUO+/7lSoEEWR1yrbjd X-Received: by 2002:a17:90b:3a85:b0:2ae:b8df:89e7 with SMTP id 98e67ed59e1d1-2bf5f74f012mr8436269a91.38.1716798355009; Mon, 27 May 2024 01:25:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716798354; cv=pass; d=google.com; s=arc-20160816; b=qzriu2XZfJqFphX9j0l2p6O+DA12TRjXZ77QkkmWYt5amihcpBsb8j3Gei6aQhkyel b9fdVQ/Usj2C+c/jtLBwbiY+nTV2OHSS6HvlS46/648uje3UMRMK69FkWYRMGyvsKa/2 Ry3MeWaEvzjaFwPxmb2+1BmntMDK6+2v7EGZELLyavVghplKSxC3wgxbCNeuHD3gm+Hx lFgQTxseGDnEaYZGX38/sCM9g+0gkGmorjEf/Opxx/CqYBnPfHFOmf0Rf8i6eHApl6jE L+JL5UrNOLT7Wft4LAnl0holY9xcQw75tZl6BBn0DVB++675ffc06qfUzNssNf2VwBzh b9bg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=5MlVXLL0h6fGrepjEUKqMT+GSQ1qSjrne66KbCMAXKE=; fh=KWsGrZL5XpR/tTrXizUzYWT+IoU1MmHdt2pKFsN8CKg=; b=lWD7dhVRi4mUkViZc4hygH2IxBrQNI+vhMzOqo+dtAFIgBjBSJlKl7LVGqSDeolOFX Qe5za9XGq+FLRo+gyqEnmU/QY32luKn+XhTzQzRM+k10RNcmwJfSDIfz0crvrXtAnd4/ f2xpZcSRLpLylK3ihi6EZPamH1Z3mXz3dgiJJFBKHAiOPgunLX+5oop6Ll8dpYikBc1G 24urJ2TcFmAubdiDn+3qLsPBNzjnWWuPew5KToXOCt7vdOVxKbk4RLJaFnl7FsXbYvGS xviVGRqvf6pySKyLmJ6OQLIKzDlXYrufhB5H9nTmYBPB1JKf9UrSM2usWhUJMgz18zEU +MMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b="KEDL/IVA"; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-190211-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190211-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bdd9ed9439si7740419a91.5.2024.05.27.01.25.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 01:25:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190211-linux.lists.archive=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=@foss.st.com header.s=selector1 header.b="KEDL/IVA"; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-190211-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190211-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com 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 E465B281A05 for ; Mon, 27 May 2024 08:25:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C0DB5380F; Mon, 27 May 2024 08:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="KEDL/IVA" Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (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 476A746453; Mon, 27 May 2024 08:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.207.212.93 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716798337; cv=none; b=t2bfgipkj9We5dscdwQO8ywsfCNbF+JDeQ4oAKCDfFjLTwW2CwyZBePZUWldvOikxFuQoJ4s3J311a1/NqiYCOv6zsN6Kfn/n3N6JW3TTwq+KBtuO4kRrdUfrXCYHlQl9DQPRrrlSB1zBBs9UdV8XkNhBmb/+8ZR9QRLhGOA+P8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716798337; c=relaxed/simple; bh=Bn2vs455rOM+Jl5xxl3oCGu3ebgM2zxGmcs3r52XYYc=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=JSHVW599kvvsB3biJ52m7BkK9Gf11NCB3lCzLY6UoOgt9g1BobiaENonfF2ERG7J6Yy/ttP4hxEQs9Z9mlicMjNqHm3y5rbVBiRMQH9qQhJvw2gy0u/OXCRr+R4oEqCCW2VrC0rBmijgOh+ZtAUddX9MkWwZ5N/mCPnzzVUhMBU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=KEDL/IVA; arc=none smtp.client-ip=91.207.212.93 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44QMsgXK002040; Mon, 27 May 2024 09:45:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= 5MlVXLL0h6fGrepjEUKqMT+GSQ1qSjrne66KbCMAXKE=; b=KEDL/IVAUCy42ZKP +HzNbTV8UT63/1WBgbgLqijzZm0mRX1RLz1JU8SPEEUN06rNTV/ArtLOOVWpaI+I 15Y+Owrei7MLgXqT8pNtvpLqBc1qfwyHhI8jEJbQSFnXJzt+AFOGzUIswrnziaZ9 xjbD9MR8aS76SK0HWEsJ9EAOOvyELXUbXQeByY7+f1Hb2pRM5IviNMSX+cA/HcOC sWRhRc2aTW4yg0Zr6L9KuR4aGzEqnAG1rJue3s38laiPSiGyCBtJ2BWZ6ovYmEf+ x/pnCU21suyPQi9Vp2ia8BPKcvo0eMGl0wwwoaw6gAtiufYS3yoUybeqTxVPvbCx l5IuHg== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3yba51nn38-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 May 2024 09:45:03 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 442B84002D; Mon, 27 May 2024 09:44:57 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 67915211975; Mon, 27 May 2024 09:44:16 +0200 (CEST) Received: from [10.130.72.241] (10.130.72.241) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 27 May 2024 09:44:15 +0200 Message-ID: <864dc1d3-2478-46a2-84a5-c7c51f96268f@foss.st.com> Date: Mon, 27 May 2024 09:44:15 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] media: i2c: Add driver for ST VD56G3 camera sensor To: Sakari Ailus CC: Sylvain Petinot , , , , , , , , , References: <20240417133453.17406-1-sylvain.petinot@foss.st.com> <20240417133453.17406-3-sylvain.petinot@foss.st.com> Content-Language: en-US From: Benjamin Mugnier In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-26_09,2024-05-24_01,2024-05-17_01 Hi Sakari, On 5/27/24 09:31, Sakari Ailus wrote: > Hi Benjamin, > > On Mon, May 13, 2024 at 03:37:25PM +0200, Benjamin Mugnier wrote: >>>>> +static int vd56g3_read_expo_cluster(struct vd56g3 *sensor, bool force_cur_val) >>>>> +{ >>>>> + u64 exposure = 0; >>>>> + u64 again = 0; >>>>> + u64 dgain = 0; >>>> >>>> Do you need the assignments? The values are assigned by cci_read() below, >>>> right? >>> >>> Well initially, I didn't have those assignments and some checker >>> complains (Honestly I didn't investigate the warning). >>> I will double check and see if they are necessary. >>> >> >> Since I have smatch ready, I ran it without these initialization against >> the latest media tree. I got these : >> >> drivers/media/i2c/st-vd56g3.c:403 vd56g3_read_expo_cluster() error: >> uninitialized symbol 'exposure'. >> drivers/media/i2c/st-vd56g3.c:404 vd56g3_read_expo_cluster() error: >> uninitialized symbol 'again'. >> drivers/media/i2c/st-vd56g3.c:405 vd56g3_read_expo_cluster() error: >> uninitialized symbol 'dgain'. >> drivers/media/i2c/st-vd56g3.c:407 vd56g3_read_expo_cluster() error: >> uninitialized symbol 'exposure'. >> drivers/media/i2c/st-vd56g3.c:408 vd56g3_read_expo_cluster() error: >> uninitialized symbol 'again'. >> drivers/media/i2c/st-vd56g3.c:409 vd56g3_read_expo_cluster() error: >> uninitialized symbol 'dgain'. >> >> cci_read() is indeed not modifying its 'var' argument in the default >> case of the switch [1]. Spawning these errors. >> Adding a '*val = 0' in the default case would also fix it, but will >> change the function behavior. > > I think I'd add the assignment to cci_read(). This isn't the only driver > that's affected. In the best case smatch would be fixed to figure this out. > > Any thoughts? IMHO adding the assignment to cci_read() is the cleanest way to handle it. > > Cc also Hans and Laurent. > -- Regards, Benjamin