summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2019-04-16 15:26:51 -0600
committerchrome-bot <chrome-bot@chromium.org>2019-04-18 19:52:08 -0700
commitaf6a8f4ef6f7f187dd536879a432451ca096f162 (patch)
tree43c10877725c628be2348d72bf06ad9672f6471c
parent2b452718a0b2e08fad8e0a830b443db862bf806c (diff)
downloadchrome-ec-af6a8f4ef6f7f187dd536879a432451ca096f162.tar.gz
Common: move for loop initial declaration
While builds on cros/master allow variables to be initially declared in for loop statements, builds on firmware branches (ex. octopus) may not. BUG=None BRANCH=octopus TEST=builds on master, builds picked to octopus branch Change-Id: I450d8c564b508a5f51a7784ce67b0664ab97d8ba Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1570609 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--common/system.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/system.c b/common/system.c
index 458798357c..53282b278d 100644
--- a/common/system.c
+++ b/common/system.c
@@ -948,8 +948,12 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd)
* TCPCs while they reset.
*/
#ifdef HAS_TASK_PD_C0
- for (int port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++)
- pd_set_suspend(port, 1);
+ {
+ int port;
+
+ for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++)
+ pd_set_suspend(port, 1);
+ }
#endif
board_reset_pd_mcu();
#endif