Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1200208rdb; Sun, 7 Jan 2024 08:02:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUhPs8asXJy9ydJ0vxGQ42DUjfv7sqF3fkhTtgDJiWtDMdUSGSo2oTog+cGZSwM1a/jObj X-Received: by 2002:a05:6122:2526:b0:4b6:dbfd:f89b with SMTP id cl38-20020a056122252600b004b6dbfdf89bmr511514vkb.27.1704643370404; Sun, 07 Jan 2024 08:02:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704643370; cv=none; d=google.com; s=arc-20160816; b=yPnViLJlLUznCpR84w7j/zqbNvp6PfxPowhp4cINOuLfwCeevk7fwju5e+EeqUASHJ CoTze25EHKgbQK8pSt2znIMnparwpUCtrYHw4+ap1Inq6C/xQ8RubRj1IOSNfjjM2BYI 7mnwvsP2lA1r+JfIjiULTH+IOknQsoI9Q0gX6IWcQJ0Q0cEtM7Dy+JhQlYEXmwLymAsD Z9V2pezH9+yyXCV7KA24zrq/xk70HbQi15ti/XWmfOpQbYfALN2R5KpotTA+eiY2mrpR 3OZ2XDSWzD3O1Ktki/m0hH3K3izbzbSR55QyIxyXDoClOtuZqooXm+Vnb4LJOdk0imeu iM8w== 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=4jA9l8esBbqOJ6rkICwfUEB4YziEAP3tQlA9jqt4TxA=; fh=HLbPVEWYvNOACdYLTeV+VhuB/z0CRXt8GPS4wCHbRpY=; b=D0lo+UaR8Y+OlTLXrCZWe1A0FLJcSMNoEEXbB+kY6p6cWrznH30NQBuESJWASuEIp7 gZojg2EaCN8XFx8S2KAxCA9OAeezdNidGJYMs8YTAKkuKGrFlSYHq6eGKlvW52RVt4hT KGKutnZSr+tF9iA2k4DKEmOhzQKaI5d4Kp9TPfQV+mtHYRbzv73VKsjBtuD31IS6bs7V HKpBonURFbPC3LRC6cadujgwVtNdVWVzcerppUbMHJSOvGyTzdTglVtI3Merar9sfcv4 PYZC++XGM/y/unBqL8iRjyM8aAsnJUGLSzk/l262fyAY0iaW0VN6uWHHIO5Wre21cmcw /EqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eMEuaZSP; spf=pass (google.com: domain of linux-kernel+bounces-18901-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18901-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 m62-20020a1fee41000000b004b75925b3ffsi744837vkh.118.2024.01.07.08.02.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 08:02:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18901-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=pass header.i=@kernel.org header.s=k20201202 header.b=eMEuaZSP; spf=pass (google.com: domain of linux-kernel+bounces-18901-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18901-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 2681E1C20FFF for ; Sun, 7 Jan 2024 16:02:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DCAF13AC2; Sun, 7 Jan 2024 16:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eMEuaZSP" X-Original-To: linux-kernel@vger.kernel.org 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 C87BE13AC0; Sun, 7 Jan 2024 16:02:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A5A9C433C7; Sun, 7 Jan 2024 16:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704643358; bh=AgdzebLM5cK9tMR3KyEkXQ/+QTHVfgE2gK9SSe5ys1Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eMEuaZSPUQm0ZR1Qt5SToxGIMZcNTEbCM+QNSkJLM5gKqwcYDQaqRJos5xHdDJkkS 9ByhjhHiuly2X6dS4AnADhP7hlDrfPPn3f70ljNVZSg2RitIcJaDo/01qCFmVvBLhI nieDyKA/DOgrLawIuL2kRR5FIWIjWb0Ear/TVrmqmcSNWqk14mFGOZGDbpKXSOLdon 4SnceSGSywhLbqIQNci3QaS5h6w3TogY4Bx89kisbvDPMLrROGmlZekC7UWsz4Baem IAvvm0c9fByABPcmhKstgJe7J8ReQJSdLJNMoZKi9KsxzD/ETL/FzZTaMOfE/411nc iMsucXAkDnB9w== Date: Sun, 7 Jan 2024 16:02:32 +0000 From: Jonathan Cameron To: David Lechner Cc: Colin Ian King , Lars-Peter Clausen , linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] iio: adc: ti-ads7950: remove redundant assignment to variable ret Message-ID: <20240107160232.4cdbae62@jic23-huawei> In-Reply-To: References: <20240106152251.54617-1-colin.i.king@gmail.com> 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=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 6 Jan 2024 12:14:22 -0600 David Lechner wrote: > On 1/6/24 9:22 AM, Colin Ian King wrote: > > Variable ret is being assigned a value that is never read, the variable > > is being re-assigned again a few statements later. Remove it. > > > > Cleans up clang scan build warning: > > warning: Value stored to 'ret' is never read [deadcode.DeadStores] > > > > Signed-off-by: Colin Ian King > > --- > > drivers/iio/adc/ti-ads7950.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-ads7950.c > > index 263fc3a1b87e..f975de059ba0 100644 > > --- a/drivers/iio/adc/ti-ads7950.c > > +++ b/drivers/iio/adc/ti-ads7950.c > > @@ -441,8 +441,6 @@ static int ti_ads7950_get(struct gpio_chip *chip, unsigned int offset) > > if (ret) > > goto out; > > > > - ret = ((st->single_rx >> 12) & BIT(offset)) ? 1 : 0; > > - > > /* Revert back to original settings */ > > st->cmd_settings_bitmask &= ~TI_ADS7950_CR_GPIO_DATA; > > st->single_tx = TI_ADS7950_MAN_CMD_SETTINGS(st); > > This does not look like the correct fix. This is the intended return value of the function in the case of no errors. So we probably need to introduce a new variable instead so that it doesn't get written over. Agreed. Needs to stash that in another local variable and return that value if ret == 0. J