summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2019-04-16 15:26:51 -0600
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-04-18 02:18:05 +0000
commitcb20b069826bc717c8ba45e5ae442ad229862a58 (patch)
tree59a89ecddfcaf8984e98d3edc850ccbabd1a88b2
parent2a245a3e1f301dfeca724a2e6132109ecfdd4783 (diff)
downloadchrome-ec-cb20b069826bc717c8ba45e5ae442ad229862a58.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/c/chromiumos/platform/ec/+/1572150
-rw-r--r--common/system.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/system.c b/common/system.c
index d1ce75616d..c9b38601a4 100644
--- a/common/system.c
+++ b/common/system.c
@@ -943,8 +943,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