Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2916946rdd; Sat, 13 Jan 2024 07:11:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFopHSii/YDP15zkHinx3p9hOz1ZpT0QuVGQJSGghWh5F33/ZNDxTalIUkr6oE7q0hR7gcy X-Received: by 2002:a05:6214:194f:b0:67a:9562:4732 with SMTP id q15-20020a056214194f00b0067a95624732mr3660126qvk.35.1705158689084; Sat, 13 Jan 2024 07:11:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705158689; cv=none; d=google.com; s=arc-20160816; b=oFUGViK5pHlef7I08yUM9ZcxB2bbX/wCYEY6CSgIIBn+6cnw3+PiKxAgN0UQRst81M 3Bce6+fNX55nAcA/D3qX7cxU9D7Tlno0t8AIFXCqXWnhufqo3ORAaN/plrz5hg3wUhhh d1f2aTMwpR4t1f6wcElHt2AtcAYU357atCyG5F5S6aFi3qOzIUu9KJH/kAAblZ79aOD/ MM+7wD0C6pwqlqiF9hilH6KM4JD1+TwO2G6u2zGD86eMmyk6QVKuRxPpXQIJYC3p+Phs CE2pSkmAjZNUcyoV9lm+bffQwyg3cxrG/PFyxnqiq6zHTBz0K7H+bnwXHRdxuzOjH3/t wOuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=SNxgylS+BvQ14Ukqq5KVpFgRSV446voJDrnZaHLOC4s=; fh=DLK45UAQ5oj35NtDjh3l6dHFC8rXRfe12i2w+9wvNH8=; b=Ng1NO5aZkSHdtvbWTMB64ZBwPWVQjdFvasPF5auMMP01fuD4zapcvwC2JqMonq5YTs X6tFJ1QtOlTAwxdoucUX6/liCzQPjcxDwvbfolhJULMB67CVtei0ljVfyrCHCyge6SfX FbuH3DUuKDpUHCpqMdFRoJ2wKRQD2ZZFDAFVXgAOIluyAPOGQLt279mF7xbuqux1JXMD y+kkPTsx8kxnGPAdjsfMDesJ/vvgabwIVETzVgtmnkM5UhorKDeAwOyEjyvMAzOxe9Wm xL1DcYndrsQzhmJM8tdTyRtdd65LH/xPO9r4JEhemuEBE35XkgU9cw6lbzUjeNbUgaYD k0Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=QmdoQlEK; spf=pass (google.com: domain of linux-kernel+bounces-25316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 q20-20020a0ce214000000b0067f99bbc77dsi4780439qvl.302.2024.01.13.07.11.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 07:11:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25316-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=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=QmdoQlEK; spf=pass (google.com: domain of linux-kernel+bounces-25316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 D39E41C210EA for ; Sat, 13 Jan 2024 15:11:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 195A11C27; Sat, 13 Jan 2024 15:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QmdoQlEK" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4A8911C16; Sat, 13 Jan 2024 15:11:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B005C433F1; Sat, 13 Jan 2024 15:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705158677; bh=joL09y98Yuho3mT9jFHr5tNy5WAX/PzaUDujGrJCA8s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QmdoQlEKM1T20vEDqhDCpJS+fPk6muzu1JhrvPGslJVrWEF8yv08sfHXz9+XbxybC 1jsapgfryR6Dhl9s4rSGOgT7c+c2dd+xv0O/FENvRSfp5htUeqV4gPPX9ySeCij9c7 UX/iD+Xyo7CD2yvWYTsM5X8vsxgqVJXeQJzWsw2C3+Jx9QW/51gQNn+6YKt8XMedMJ qV/YGMhrhGpPWRolUGFVwRqa0yDKlY+Tl2369ePD5qiE2SxGxbHg/JelitmZXPbOen jwsp7NbSvAIdIetW9w05u6rv2vJ+e/m5w35qfsBmUTMhKVHdtiv90cJzC6go/9+dOU ZrsAHL4d0KAbQ== Date: Sat, 13 Jan 2024 15:11:13 +0000 From: Jonathan Cameron To: Jean-Baptiste Maneyrol Cc: Colin Ian King , Lars-Peter Clausen , Andy Shevchenko , "linux-iio@vger.kernel.org" , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH][next] iio: invensense: remove redundant initialization of variable period Message-ID: <20240113151113.44bef633@jic23-huawei> In-Reply-To: References: <20240106153202.54861-1-colin.i.king@gmail.com> <20240107160736.14f3ae1d@jic23-huawei> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.39; x86_64-pc-linux-gnu) 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-Transfer-Encoding: quoted-printable On Sun, 7 Jan 2024 20:18:03 +0000 Jean-Baptiste Maneyrol wrote: > Hello Colin & Jonathan, >=20 > this is OK for me, thanks for the patch. > The initialization is certainly coming from first development and is not = needed. >=20 > Acked-by: Jean-Baptiste Maneyrol Applied to the togreg branch of iio.git and pushed out as testing. I'll be rebasing that tree on rc1 once available. Thanks, Jonathan >=20 > Thanks, > JB >=20 > From: Jonathan Cameron > Sent: Sunday, January 7, 2024 17:07 > To: Colin Ian King > Cc: Lars-Peter Clausen ; Jean-Baptiste Maneyrol ; Andy Shevchenko ; linu= x-iio@vger.kernel.org ; kernel-janitors@vger.ker= nel.org ; linux-kernel@vger.kernel.org > Subject: Re: [PATCH][next] iio: invensense: remove redundant initializati= on of variable period=20 > =C2=A0 > On Sat, 6 Jan 2024 15:=E2=80=8A32:=E2=80=8A02 +0000 Colin Ian King wrote: > The variabl= e period is being initialized with a value that is never > read, it is bein= g re-assigned a new value later on before it is read. >=20 > ZjQcmQRYFpfptBannerStart > This Message Is From an External Sender=20 > This message came from outside your organization.=20 > =C2=A0 > ZjQcmQRYFpfptBannerEnd > On Sat, 6 Jan 2024 15:32:02 +0000 > Colin Ian King wrote: >=20 > > The variable period is being initialized with a value that is never > > read, it is being re-assigned a new value later on before it is read. > > The initialization is redundant and can be removed. > >=20 > > Cleans up clang scan build warning: > > Value stored to 'period' during its initialization is never > > read [deadcode.DeadStores] > >=20 > > Signed-off-by: Colin Ian King =20 > Hi Colin, >=20 > I definitely want input from someone who can test this. > There is direct use of ts->period as well as the local > variable that is indeed overwritten as you've noted. > Feels like naming needs some work and perhaps reduce the scope of > the period local variable so it's obvious it was only intended > for more local use than it currently looks like. >=20 > Thanks, >=20 > Jonathan >=20 > > --- > > drivers/iio/common/inv_sensors/inv_sensors_timestamp.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/d= rivers/iio/common/inv_sensors/inv_sensors_timestamp.c > > index 03823ee57f59..3b0f9598a7c7 100644 > > --- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c > > +++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c > > @@ -126,7 +126,7 @@ void inv_sensors_timestamp_interrupt(struct inv_sen= sors_timestamp *ts, > > struct inv_sensors_timestamp_interval *it; > > int64_t delta, interval; > > const uint32_t fifo_mult =3D fifo_period / ts->chip.clock_period; > > - uint32_t period =3D ts->period; > > + uint32_t period; > > bool valid =3D false; > > =20 > > if (fifo_nb =3D=3D 0) =20 >=20 >=20