summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorEvan Green <evgreen@chromium.org>2019-09-23 12:57:40 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-05 00:47:45 +0000
commit3564b23531fc1814924f39e7ac97751d758c14db (patch)
tree39a04f30177288afe594f0d2a22a434a4a5b00f6 /chip
parente34fca3e01d75552ad8d712879c3ccd6a6168584 (diff)
downloadchrome-ec-3564b23531fc1814924f39e7ac97751d758c14db.tar.gz
printf: Add support for %z
When printing size_t sized integers, utilize the standard %z modifier so that the specifier format is correct. This will enable us to turn on compile-time printf format verification. BUG=chromium:984041 TEST=make -j buildall BRANCH=none Cq-Depend:chrome-internal:1860160 Change-Id: I2c95df5c0d87677cb9fcbde33ab8846708a774a1 Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819651 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/ish/heci.c4
-rw-r--r--chip/it83xx/ec2i.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/chip/ish/heci.c b/chip/ish/heci.c
index 146aa175f5..309a17c0a1 100644
--- a/chip/ish/heci.c
+++ b/chip/ish/heci.c
@@ -891,8 +891,8 @@ static int is_hbm_validity(struct hbm_h2i *h2i, size_t length)
}
if (valid_msg_len != length) {
- CPRINTF("invalid cmd(%d) valid : %d, cur : %d\n",
- valid_msg_len, length);
+ CPRINTF("invalid cmd(%d) valid : %d, cur : %zd\n",
+ h2i->cmd, valid_msg_len, length);
/* TODO: invalid cmd. not sure to reply with error ? */
return 0;
}
diff --git a/chip/it83xx/ec2i.c b/chip/it83xx/ec2i.c
index 80cd08ecc9..fe657438c4 100644
--- a/chip/it83xx/ec2i.c
+++ b/chip/it83xx/ec2i.c
@@ -284,7 +284,7 @@ static void pnpcfg_configure(const struct ec2i_t *settings, size_t entries)
for (i = 0; i < entries; i++) {
if (ec2i_write(settings[i].index_port, settings[i].data_port) ==
EC2I_WRITE_ERROR) {
- ccprints("Failed to apply %d", i);
+ ccprints("Failed to apply %zd", i);
break;
}
}