diff options
author | Simon Glass <sjg@chromium.org> | 2023-05-08 15:29:21 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-05-11 14:04:26 +0000 |
commit | a8a46c931fbd8effe479f98d5cadb4140460f5f6 (patch) | |
tree | 307ad748874b7c40c08d2179e3b2473d63fc21c6 | |
parent | 47acf64182ccc833bb590c6d307d6e7c66a93360 (diff) | |
download | chrome-ec-a8a46c931fbd8effe479f98d5cadb4140460f5f6.tar.gz |
host_command_pd: Avoid using charger_state as a variable
We have enum charge_state_v2 and used to have enum charge_state. Try
to avoid using charger_state in the source except as an enum.
This makes no functional change.
BUG=b:218332694
TEST=make buildall
Change-Id: I68e4eb3112a32be00819f74c51ea744d148a88d5
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516189
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
-rw-r--r-- | common/host_command_pd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/host_command_pd.c b/common/host_command_pd.c index e7dbbc2b5f..062113fb0e 100644 --- a/common/host_command_pd.c +++ b/common/host_command_pd.c @@ -32,7 +32,7 @@ #ifdef CONFIG_HOSTCMD_PD_CHG_CTRL /* By default allow 5V charging only for the dead battery case */ -static enum pd_charge_state charge_state = PD_CHARGE_5V; +static enum pd_charge_state pd_chg_state = PD_CHARGE_5V; #define CHARGE_PORT_UNINITIALIZED -2 static int charge_port = CHARGE_PORT_UNINITIALIZED; @@ -48,7 +48,7 @@ void host_command_pd_send_status(enum pd_charge_state new_chg_state) #ifdef CONFIG_HOSTCMD_PD_CHG_CTRL /* Update PD MCU charge state if necessary */ if (new_chg_state != PD_CHARGE_NO_CHANGE) - charge_state = new_chg_state; + pd_chg_state = new_chg_state; #endif /* Wake PD HC task to send status */ task_set_event(TASK_ID_PDCMD, TASK_EVENT_EXCHANGE_PD_STATUS); @@ -74,7 +74,7 @@ static void pd_exchange_update_ec_status(struct ec_params_pd_status *ec_status, { /* Send PD charge state and battery state of charge */ #ifdef CONFIG_HOSTCMD_PD_CHG_CTRL - ec_status->charge_state = charge_state; + ec_status->charge_state = pd_chg_state; #endif if (charge_get_flags() & CHARGE_FLAG_BATT_RESPONSIVE) ec_status->batt_soc = charge_get_percent(); |