diff mbox series

[-next] power: supply: charger-manager: Remove unused but set variable 'charger'

Message ID 20200909112917.5071-1-weiyongjun1@huawei.com
State New
Headers show
Series [-next] power: supply: charger-manager: Remove unused but set variable 'charger' | expand

Commit Message

Wei Yongjun Sept. 9, 2020, 11:29 a.m. UTC
Gcc report warning as follows:

drivers/power/supply/charger-manager.c:1626:29: warning:
 variable 'charger' set but not used [-Wunused-but-set-variable]
 1626 |   struct charger_regulator *charger;
      |                             ^~~~~~~

After c1f73028f75d ("power: supply: charger-manager: Update extcon
functions"), 'charger' is never be used, so removing it to avoid
build warning.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: c1f73028f75d ("power: supply: charger-manager: Update extcon functions")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/power/supply/charger-manager.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 07992821e252..b2ca79173f95 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1622,13 +1622,8 @@  static int charger_manager_probe(struct platform_device *pdev)
 	return 0;
 
 err_reg_extcon:
-	for (i = 0; i < desc->num_charger_regulators; i++) {
-		struct charger_regulator *charger;
-
-		charger = &desc->charger_regulators[i];
-
+	for (i = 0; i < desc->num_charger_regulators; i++)
 		regulator_put(desc->charger_regulators[i].consumer);
-	}
 
 	power_supply_unregister(cm->charger_psy);