diff options
author | Patryk Duda <pdk@semihalf.com> | 2021-06-16 09:56:56 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-17 11:04:48 +0000 |
commit | 2219c2267a301978877fd17f5e60ed850bf7956d (patch) | |
tree | 721e2a7ba3caffe0b37250bf335b1cee85e7afd9 /driver | |
parent | f767b8ebaa0b304aa79167c2407d1d1fc5618c63 (diff) | |
download | chrome-ec-2219c2267a301978877fd17f5e60ed850bf7956d.tar.gz |
Fix compilation issues with nocturne SDK
Compiler in nocturne cros SDK doesn't allow for variable declaration
inside for loop. This patch removes variable declaration inside for
loop in code which is used by nocturne board.
This patch doesn't introduce any logical changes.
BUG=b:160676144
BRANCH=none
TEST=Make sure EC points to commit on cros/main.
On nocturne SDK:
cros_workon-nocturne start chromeos-ec
emerge-nocturne chromeos-ec chromeos-bootimage
Make sure that firmware compiles
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: I75ff21d966d5e353d1f7873695127bac4357fb32
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965922
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/tcpm/ps8xxx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c index b9e83c6d13..798fe266d6 100644 --- a/driver/tcpm/ps8xxx.c +++ b/driver/tcpm/ps8xxx.c @@ -292,10 +292,12 @@ static struct ps8xxx_variant_map variant_map[] = { static int get_reg_by_product(const int port, const enum ps8xxx_variant_regs reg) { + int i; + if (reg < REG_FIRST_INDEX || reg >= REG_MAX_COUNT) return INT32_MAX; - for (int i = 0; i < ARRAY_SIZE(variant_map); i++) { + for (i = 0; i < ARRAY_SIZE(variant_map); i++) { if (product_id[port] == variant_map[i].product_id) { return variant_map[i].reg_map[reg]; @@ -611,7 +613,9 @@ static int ps8xxx_enter_low_power_mode(int port) static int ps8xxx_dci_disable(int port) { - for (int i = 0; i < ARRAY_SIZE(variant_map); i++) { + int i; + + for (i = 0; i < ARRAY_SIZE(variant_map); i++) { if (product_id[port] == variant_map[i].product_id) return variant_map[i].dci_disable_ptr(port); } |