Skip to contentSkip to conversation

power: supply: charger-manager: Fix info message in check_charging_duration()

PATCH Superseded Gustavo A. R. Silva 2 participants 2 messages Sep 2, 2020 Power supply

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: charger-manager: Fix info message in check_charging_duration()

A few months ago, commit e132fc6bb89b ("power: supply: charger-manager: Make decisions focussed on battery status") changed the expression in the if statement from "duration > desc->discharging_max_duration_ms" to "duration > desc->charging_max_duration_ms", but the arguments for dev_info() were left unchanged. Apparently, due to a copy-paste error.

Fix this by using the proper arguments for dev_info().

Addresses-Coverity-ID: 1496803 ("Copy-paste error")

Fixes e132fc6bb89b ("power: supply: charger-manager: Make decisions focussed on battery status")
---
 drivers/power/supply/charger-manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/charger-manager.c +2 -2
index 07992821e252..6117018e89df 100644
@@ -472,8 +472,8 @@ static int check_charging_duration(struct charger_manager *cm)
 		duration = curr - cm->charging_end_time;
 
 		if (duration > desc->charging_max_duration_ms) {
-			dev_info(cm->dev, "Discharging duration exceed %ums\n",
-				 desc->discharging_max_duration_ms);
+			dev_info(cm->dev, "Charging duration exceed %ums\n",
+				 desc->charging_max_duration_ms);
 			ret = true;
 		}
 	}
Signature · 1 line
2.27.0
#1 lore raw
Quoted 19 lines · Gustavo A. R. Silva

A few months ago, commit e132fc6bb89b ("power: supply: charger-manager: Make decisions focussed on battery status") changed the expression in the if statement from "duration > desc->discharging_max_duration_ms" to "duration > desc->charging_max_duration_ms", but the arguments for dev_info() were left unchanged. Apparently, due to a copy-paste error.

Fix this by using the proper arguments for dev_info().

Addresses-Coverity-ID: 1496803 ("Copy-paste error")

Fixes e132fc6bb89b ("power: supply: charger-manager: Make decisions focussed on battery status")
---
 drivers/power/supply/charger-manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/charger-manager.c +0 -0
index 07992821e252..6117018e89df 100644

drivers/power/supply/charger-manager.c static int check_charging_duration(struct charger_manager *cm) · line 475

Quoted 6 lines
drivers/power/supply/charger-manager.c +1 -2
@@ -472,8 +472,8 @@ static int check_charging_duration(struct charger_manager *cm)
 		duration = curr - cm->charging_end_time;
 
 		if (duration > desc->charging_max_duration_ms) {
-			dev_info(cm->dev, "Discharging duration exceed %ums\n",
-				 desc->discharging_max_duration_ms);
+			dev_info(cm->dev, "Charging duration exceed %ums\n",

preferably exceeds

drivers/power/supply/charger-manager.c static int check_charging_duration(struct charger_manager *cm) · line 479

Quoted 5 lines
drivers/power/supply/charger-manager.c +1 -0
+				 desc->charging_max_duration_ms);
 			ret = true;
 		}
 	}

thanks.

Signature · 1 line
~Randy