diff options
author | Evan Green <evgreen@chromium.org> | 2019-07-19 16:20:45 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-05 00:47:36 +0000 |
commit | 0128582fe62b51a74a4c6c5a91e9c5118e70e376 (patch) | |
tree | 7d8d96c756da853b87d36497ba649b1fc8dad398 /driver/accel_lis2dw12.c | |
parent | a41fea6b7df1c83072140c0da9e07f09a8b032e4 (diff) | |
download | chrome-ec-0128582fe62b51a74a4c6c5a91e9c5118e70e376.tar.gz |
printf: Convert %T to %pT
In order to be more compliant to standards, and ultimately turn on
compile-time printf format validation, switch the non-standard %T
into %pT, which takes a pointer to a 64-bit timestamp as an argument.
For convenience, define PRINTF_TIMESTAMP_NOW, which will use the
current time as the timestamp value, rather than forcing everyone
to pass a pointer to get_time().val.
For a couple of instances, simply use CPRINTS instead.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=None
Cq-Depend:chrome-internal:1473305
Change-Id: I83e45b55a95ea27256dc147544ae3f7e39acc5dd
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704216
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'driver/accel_lis2dw12.c')
-rw-r--r-- | driver/accel_lis2dw12.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/driver/accel_lis2dw12.c b/driver/accel_lis2dw12.c index a38e7e91c6..66edd8723e 100644 --- a/driver/accel_lis2dw12.c +++ b/driver/accel_lis2dw12.c @@ -18,6 +18,7 @@ #include "util.h" #define CPRINTF(format, args...) cprintf(CC_ACCEL, format, ## args) +#define CPRINTS(format, args...) cprints(CC_ACCEL, format, ## args) /* Only when configured as base accel sensor, fifo and interrupt * are supported. @@ -463,7 +464,7 @@ static int read(const struct motion_sensor_t *s, intv3_t v) LIS2DW12_OUT_X_L_ADDR, raw, OUT_XYZ_SIZE); if (ret != EC_SUCCESS) { - CPRINTF("[%T %s type:0x%X RD XYZ Error]", s->name, s->type); + CPRINTS("%s type:0x%X RD XYZ Error", s->name, s->type); return ret; } @@ -559,8 +560,7 @@ static int init(const struct motion_sensor_t *s) err_unlock: mutex_unlock(s->mutex); - CPRINTF("[%T %s: MS Init type:0x%X Error]\n", s->name, s->type); - + CPRINTS("%s: MS Init type:0x%X Error", s->name, s->type); return EC_ERROR_UNKNOWN; } |