lkml.org 
[lkml]   [2023]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] power: supply: twl4030-charger: remove unused cur_reg variable
Date
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
\
 
 \ /
  Last update: 2023-04-01 13:35    [W:0.029 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site