From af6a8f4ef6f7f187dd536879a432451ca096f162 Mon Sep 17 00:00:00 2001 From: Diana Z Date: Tue, 16 Apr 2019 15:26:51 -0600 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/1570609 Reviewed-by: Daisuke Nojiri Reviewed-by: Jett Rink --- common/system.c | 8 ++++++-- 1 file 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 -- cgit v1.2.1