linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] power: supply: charger-manager: Remove unused but set variable 'charger'
@ 2020-09-09 11:29 Wei Yongjun
  0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2020-09-09 11:29 UTC (permalink / raw)
  To: Hulk Robot, Sebastian Reichel, Jonathan Bakker; +Cc: Wei Yongjun, linux-pm

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 --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);
 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-09 11:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 11:29 [PATCH -next] power: supply: charger-manager: Remove unused but set variable 'charger' Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).