power: supply: ab8500: remove unused static local variable
Subsystems (2)
PATCH 1/1 power: supply: ab8500: remove unused static local variable
cpp_check reports
[drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.
From inspection, this variable is never used. So remove it.
--- drivers/power/supply/ab8500_chargalg.c | 2 -- 1 file changed, 2 deletions(-)
drivers/power/supply/ab8500_chargalg.c +0 -2
@@ -490,8 +490,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di)static int ab8500_chargalg_ac_en (struct ab8500_chargalg *di,int enable,int vset_uv,int iset_ua) { -static int ab8500_chargalg_ex_ac_enable_toggle; -if (!di->ac_chg || !di->ac_chg->ops.enable)return -ENXIO ;
Signature · 1 line
2.27.0
Quoted 7 lines · Tom Rix
cpp_checkreports
[drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.From inspection, this variable is never used. So remove it.
Fixes 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")Signed-off-by Tom Rix <[email protected]>
Thanks Tom!
Yours,
Linus Walleij
Quoted 5 lines
Quoted 5 lines
cpp_checkreports
[drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.From inspection, this variable is never used. So remove it.
Quoted 8 lines
Quoted 2 lines
Fixes 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")Signed-off-by Tom Rix <[email protected]>Thanks Tom!
Reviewed-by Linus Walleij <[email protected]>Yours,
Linus Walleij
Hi Sebastian,
It looks like that this patch is not in linux-next 20220812
and I can still observe this build error with ARCH=arm, defconfig=allyesconfig.
Would you pick up this fix, please?
Thanks,
Miles
Quoted 17 lines · Tom Rix
cpp_checkreports
[drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.Quoted 1 line
From inspection, this variable is never used. So remove it.
Fixes 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")Signed-off-by Tom Rix <[email protected]>--- drivers/power/supply/ab8500_chargalg.c | 2 -- 1 file changed, 2 deletions(-)drivers/power/supply/ab8500_chargalg.c +0
-0
drivers/power/supply/ab8500_chargalg.c static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di) · line 495
Quoted 8 lines
drivers/power/supply/ab8500_chargalg.c +0
-2@@ -490,8 +490,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di)static int ab8500_chargalg_ac_en (struct ab8500_chargalg *di,int enable,int vset_uv,int iset_ua) { -static int ab8500_chargalg_ex_ac_enable_toggle; -if (!di->ac_chg || !di->ac_chg->ops.enable)return -ENXIO ;
I can still observe this build error with ARCH=arm, defconfig=allyesconfig in linux-next next-200816:
drivers/power/supply/ab8500_chargalg.c: In function ‘ab8500_chargalg_ac_en’:drivers/power/supply/ab8500_chargalg.c:493:13: error: unused variable ‘ab8500_chargalg_ex_ac_enable_toggle’ [-Werror=unused-variable]
static int ab8500_chargalg_ex_ac_enable_toggle;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~chenlifu
Reviewed-byQuoted 30 lines · chenlifu
Quoted 17 lines · Tom Rix
cpp_checkreports
[drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.Quoted 1 line
From inspection, this variable is never used. So remove it.
Fixes 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")Signed-off-by Tom Rix <[email protected]>---
drivers/power/supply/ab8500_chargalg.c| 2 --1 file changed, 2 deletions(-)drivers/power/supply/ab8500_chargalg.c +0
-0drivers/power/supply/ab8500_chargalg.c static int ab8500_chargalg_kick_watchdog(struct · line 495
Quoted 8 lines
drivers/power/supply/ab8500_chargalg.c +0
-2@@ -490,8 +490,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di) static int ab8500_chargalg_ac_en(struct ab8500_chargalg *di, int enable, int vset_uv, int iset_ua) { - static int ab8500_chargalg_ex_ac_enable_toggle; - if (!di->ac_chg || !di->ac_chg->ops.enable) return -ENXIO;Reviewed-by Chen Lifu <[email protected]>
Quoted 7 lines
I can still observe this build error with ARCH=arm, defconfig=allyesconfig in linux-next next-200816:
drivers/power/supply/ab8500_chargalg.c: In function ‘ab8500_chargalg_ac_en’:drivers/power/supply/ab8500_chargalg.c:493:13: error: unused variable ‘ab8500_chargalg_ex_ac_enable_toggle’ [-Werror=unused-variable]
static intab8500_chargalg_ex_ac_enable_toggle;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.
fixed the tag: next-200816 --> next-20220816
I can still observe this build error with ARCH=arm, defconfig=allyesconfig in linux-next next-20220816:
drivers/power/supply/ab8500_chargalg.c: In function ‘ab8500_chargalg_ac_en’:drivers/power/supply/ab8500_chargalg.c:493:13: error: unused variable ‘ab8500_chargalg_ex_ac_enable_toggle’ [-Werror=unused-variable]
static int ab8500_chargalg_ex_ac_enable_toggle;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Hi,
Quoted 8 lines · Tom Rix
cpp_checkreports
[drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used.From inspection, this variable is never used. So remove it.
Fixes 6c50a08d9dd3 ("power: supply: ab8500: Drop external charger leftovers")Signed-off-by Tom Rix <[email protected]>---
Thanks, queued into power-supply's fixes branch.
Sorry for the delay.
-- Sebastian
Quoted 19 lines
drivers/power/supply/ab8500_chargalg.c | 2 -- 1 file changed, 2 deletions(-)drivers/power/supply/ab8500_chargalg.c +0
-2@@ -490,8 +490,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di)static int ab8500_chargalg_ac_en (struct ab8500_chargalg *di,int enable,int vset_uv,int iset_ua) { -static int ab8500_chargalg_ex_ac_enable_toggle; -if (!di->ac_chg || !di->ac_chg->ops.enable)return -ENXIO ;Signature · 1 line
2.27.0