summaryrefslogtreecommitdiff
path: root/driver/accelgyro_bmi160.c
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 /driver/accelgyro_bmi160.c
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 'driver/accelgyro_bmi160.c')
-rw-r--r--driver/accelgyro_bmi160.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/driver/accelgyro_bmi160.c b/driver/accelgyro_bmi160.c
index aa4eaf13c7..5fd9e3acda 100644
--- a/driver/accelgyro_bmi160.c
+++ b/driver/accelgyro_bmi160.c
@@ -990,7 +990,7 @@ static int load_fifo(struct motion_sensor_t *s, uint32_t last_ts)
state = FIFO_DATA_CONFIG;
break;
default:
- CPRINTS("Unknown header: 0x%02x @ %d",
+ CPRINTS("Unknown header: 0x%02x @ %zd",
hdr, bp - bmi160_buffer);
raw_write8(s->port, s->i2c_spi_addr_flags,
BMI160_CMD_REG,
@@ -1000,13 +1000,13 @@ static int load_fifo(struct motion_sensor_t *s, uint32_t last_ts)
break;
}
case FIFO_DATA_SKIP:
- CPRINTS("@ %d - %d, skipped %d frames",
+ CPRINTS("@ %zd - %d, skipped %d frames",
bp - bmi160_buffer, length, *bp);
bp++;
state = FIFO_HEADER;
break;
case FIFO_DATA_CONFIG:
- CPRINTS("@ %d - %d, config change: 0x%02x",
+ CPRINTS("@ %zd - %d, config change: 0x%02x",
bp - bmi160_buffer, length, *bp);
bp++;
state = FIFO_HEADER;