From: Tom Rix <trix@redhat.com>
To: sre@kernel.org, nathan@kernel.org, ndesaulniers@google.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Tom Rix <trix@redhat.com>
Subject: [PATCH] power: supply: twl4030-charger: remove unused cur_reg variable
Date: Sat, 1 Apr 2023 07:34:32 -0400 [thread overview]
Message-ID: <20230401113432.1873847-1-trix@redhat.com> (raw)
clang with W=1 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.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/power/supply/twl4030_charger.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/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 twl4030_bci *bci)
{
int status;
int cur;
- unsigned reg, cur_reg;
+ unsigned reg;
u8 bcictl1, oldreg, fullreg;
bool cgain = false;
u8 boot_bci;
@@ -357,11 +357,9 @@ static int twl4030_charger_update_current(struct twl4030_bci *bci)
status = twl4030_bci_read(TWL4030_BCIIREF1, &oldreg);
if (status < 0)
return status;
- cur_reg = oldreg;
status = twl4030_bci_read(TWL4030_BCIIREF2, &oldreg);
if (status < 0)
return status;
- cur_reg |= oldreg << 8;
if (reg != oldreg) {
/* disable write protection for one write access for
* BCIIREF */
--
2.27.0
next reply other threads:[~2023-04-01 11:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-01 11:34 Tom Rix [this message]
2023-04-01 20:30 ` [PATCH] power: supply: twl4030-charger: remove unused cur_reg variable Sebastian Reichel
2023-04-01 21:39 ` Andreas Kemnade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230401113432.1873847-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.