summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2021-06-16 09:56:56 +0000
committerCommit Bot <commit-bot@chromium.org>2021-06-17 11:04:48 +0000
commit2219c2267a301978877fd17f5e60ed850bf7956d (patch)
tree721e2a7ba3caffe0b37250bf335b1cee85e7afd9 /chip
parentf767b8ebaa0b304aa79167c2407d1d1fc5618c63 (diff)
downloadchrome-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 'chip')
-rw-r--r--chip/npcx/system.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/chip/npcx/system.c b/chip/npcx/system.c
index ce8851b18f..48727c2686 100644
--- a/chip/npcx/system.c
+++ b/chip/npcx/system.c
@@ -1082,6 +1082,7 @@ const char *system_get_chip_revision(void)
#ifdef CHIP_FAMILY_NPCX7
uint8_t chip_id = NPCX_DEVICE_ID_CR;
#endif
+ int s;
switch (chip_gen) {
#if defined(CHIP_FAMILY_NPCX5)
@@ -1115,7 +1116,7 @@ const char *system_get_chip_revision(void)
* For npcx5/npcx7, the revision number is 1 byte.
* For NPCX9 and later chips, the revision number is 4 bytes.
*/
- for (int s = sizeof(rev_num) - 1; s >= 0; s--) {
+ for (s = sizeof(rev_num) - 1; s >= 0; s--) {
uint8_t r = rev_num >> (s * 8);
*p++ = system_to_hex(r >> 4);