Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2729059rwl; Sat, 1 Apr 2023 13:31:25 -0700 (PDT) X-Google-Smtp-Source: AK7set+PsynX1Wqy2NgxKiZ8WppTPfwsRruFfQ7AfkT7liZWConfEyO4QG2g7TaFhet56geT3aGY X-Received: by 2002:a05:6a20:c2a7:b0:d6:ba0b:c82c with SMTP id bs39-20020a056a20c2a700b000d6ba0bc82cmr27838030pzb.38.1680381085368; Sat, 01 Apr 2023 13:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680381085; cv=none; d=google.com; s=arc-20160816; b=SyU5Gkmpadpv7HwpnMaOoZCZ4SF0OiE22cAUNeBb0xd/WXaQ5Pv4bSav9O+mx+C3XK Th2l5QEA5dUowLlqWb9Hf+H0hJAnmi8O1GlWDoZF+BzzqxRkPvsrPCs+3EOUbwMNba87 MxFaR2qlKM9n6Lnl4Wbs7D2+ChOcS3Sn9hD7vjX7JY72t20lNnOc1FCfwzFy59GrSUUD Wuxf3+XiXgIVlCfBrQYp9idptzAdwjZBRhGtKst5bPDGmKKigb2AUxfaTu8/ojV1XvaV Ls5UWtL9XxX8WEAGqg/af7IY/vk6j7FXxXJnMURQQB7B1y0/Me2yMu05YP10ZzRmTn8D LhOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Hec5w9zkL4FwqtSOGcRddFMQsQ3S+od6xK3MvORGBLc=; b=Nc0Q0F+WMbLsssDNYGw11dyo47atXThOD21mKjq1gRJflMmWkUIUwiM6Rwllcxx5+v tkFlE0MbSOCr3PnVcGOUYFlGWZgw/TUJa5e48/51RHcLsH82ods83mRUTdtGRfvbnJ8G jMDdU1N4BG5olCulRQ99vAiGvwMg/IfRmUMhZ18yPR/b/4UBnPwlyZcTuhMsIqwfxyzn dikWlIVpp28gU9ARO3d5jR5U5VpCePF1SAprBrc9IqVdBl6LHgiPCZxS0l0bLzfjEzuM JshaUIQANGM1ImmQVXNGVXflkAUhF4dVqfPsgCbaSH5uUspT4/wN01eu6x1aGyk92UDV S2xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=lKi4CdAN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a655909000000b004ff6eee7176si5189623pgu.261.2023.04.01.13.31.07; Sat, 01 Apr 2023 13:31:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=lKi4CdAN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229681AbjDAUae (ORCPT + 99 others); Sat, 1 Apr 2023 16:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjDAUad (ORCPT ); Sat, 1 Apr 2023 16:30:33 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ED7BC669; Sat, 1 Apr 2023 13:30:31 -0700 (PDT) Received: from mercury (unknown [185.209.196.239]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id 77EBA66030C4; Sat, 1 Apr 2023 21:30:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1680381029; bh=YzmZJzLAOt9Kefz8r1tk+YrbDj+ypz+EkDt0+WX3YpA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lKi4CdANBtbKhg0xQoFMSHXZcwmziR9fMMChivQ0oyM4iVY/Jfen9Q0BYeafYXJSO h3TDxA1UFtbHk6EaWlFeGsAjtEpY/U+WU2OK7Mow562NQuuenTNaCNNgrjsm8t1DGM 8apySrygtU6RQ6gRyKzU8CqbvBkqn9rpAjkhl8wjfAF1TBh/vpNZQuUhBa6QuW722C LiBUhyuhU0bpgyJq9UeHiH0uCsIS7sVAufIDem3wsQAk+McE+NE1q9DKEKQvHnQgJp LSiP8dj4Z4veg87Os6q5Dz7Rok9IIPDetdXaB1b4gHdOEJDlo98oZh1BClWiS+qB/O KzU+ab3OEnhTw== Received: by mercury (Postfix, from userid 1000) id EA5EE1062746; Sat, 1 Apr 2023 22:30:26 +0200 (CEST) Date: Sat, 1 Apr 2023 22:30:26 +0200 From: Sebastian Reichel To: Tom Rix Cc: nathan@kernel.org, ndesaulniers@google.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Andreas Kemnade , "H. Nikolaus Schaller" Subject: Re: [PATCH] power: supply: twl4030-charger: remove unused cur_reg variable Message-ID: <20230401203026.nzk4aygv7sr7quhe@mercury.elektranox.org> References: <20230401113432.1873847-1-trix@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mfptafjvzvw5h7cx" Content-Disposition: inline In-Reply-To: <20230401113432.1873847-1-trix@redhat.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mfptafjvzvw5h7cx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sat, Apr 01, 2023 at 07:34:32AM -0400, Tom Rix wrote: > clang with W=3D1 reports > drivers/power/supply/twl4030_charger.c:242:16: error: variable > 'cur_reg' set but not used [-Werror,-Wunused-but-set-variable] > unsigned reg, cur_reg; > ^ > This variable is not used so remove it. >=20 > Signed-off-by: Tom Rix > --- > drivers/power/supply/twl4030_charger.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/suppl= y/twl4030_charger.c > index 7adfd69fe649..5fa5b2311330 100644 > --- a/drivers/power/supply/twl4030_charger.c > +++ b/drivers/power/supply/twl4030_charger.c > @@ -239,7 +239,7 @@ static int twl4030_charger_update_current(struct twl4= 030_bci *bci) > { > int status; > int cur; > - unsigned reg, cur_reg; > + unsigned reg; > u8 bcictl1, oldreg, fullreg; > bool cgain =3D false; > u8 boot_bci; > @@ -357,11 +357,9 @@ static int twl4030_charger_update_current(struct twl= 4030_bci *bci) > status =3D twl4030_bci_read(TWL4030_BCIIREF1, &oldreg); > if (status < 0) > return status; > - cur_reg =3D oldreg; > status =3D twl4030_bci_read(TWL4030_BCIIREF2, &oldreg); > if (status < 0) > return status; > - cur_reg |=3D oldreg << 8; > if (reg !=3D oldreg) { I think the correct fix would be checking for (reg !=3D cur_reg) here. -- Sebastian > /* disable write protection for one write access for > * BCIIREF */ > --=20 > 2.27.0 >=20 --mfptafjvzvw5h7cx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmQolF4ACgkQ2O7X88g7 +poTpw/4qkx6YJ+9tkZXsBoUZCdHoevMWeMg4FDt6d351ZoMDrZQyLWkrrQglRt6 rwnpaReLsWPt3q9TmZwsQ5892JZOZw5QMOUHyfGhlCBPp7wiY35PQ0Ihff0NyzoJ KermMpArXyjcL4meLX8Q5NRlanU4TpDJwN03SmJziryemQI5ytwGxjBBXOcvq2hB ck2Py7rSk8FgBAtNAA2tjV05eJL6rVRcD3JknZicSQ1F1CissdhlJS72OdUhRDVj ydmiXywW1jTEMCMrXG92x3COR0Niv/MH0PjlMakYKrjUlD0hMXUsNLq4CRjknhRu QnGF1kGtBSd15ANhNNcqOmSTyC7uWzvQTOnE1Ge0wbMNVXSNeHFvieRxN5EOEAC0 6Yt9xUDMQtMIVoBgzUk3GAdwSvW+mYBXC14UlTFzfRKh0GozhZSuG8Ee+rtEdovn xqdTx/mxR75AWTiL/JsbAzrkCv3+Yt7sSwvcsz5CseNXxWvuWt/W7apC9HSvEd7O L7eR1iaB42II2oJJBtZra0Lp4bscslMwmXK7B9/Zjkdn5SnD0vttBuBAEpgksU/4 thNJUNt8jtS0WSKbAjeJEWpFwxo9Yha1grP4wXqDgGpuEYZjUFLqp+C/HgSoS4sO Onf5LmXisLayRqToKWUUEmRfOa+a/xTicUvyxrxeOVdmLOolbg== =28ub -----END PGP SIGNATURE----- --mfptafjvzvw5h7cx--