diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2019-11-08 14:12:56 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-09 01:59:01 +0000 |
commit | ffb96cd5ba990c8d6d91a044105eb225087781aa (patch) | |
tree | 254e0979dc57c6e2b77272e3229edb3c794d2d71 /common/printf.c | |
parent | c11e35229eea194394d06944b75f0ad7e012d941 (diff) | |
download | chrome-ec-ffb96cd5ba990c8d6d91a044105eb225087781aa.tar.gz |
printf: be consistent using PRINTF_TIMESTAMP_NOW
PRINTF_TIMESTAMP_NOW is used to indicate that %pT format specifier
means 'current time'. Let's use it at the point where format is
analyzed to be consistent with the rest of the EC tree.
BRANCH=none
BUG=none
TEST=make buildall succeeds, 'ccprintf ("%pT", PRINTF_TIMESTAMP_NOW);'
still prints the current time.
Change-Id: I42e80039a4335015f5504830070ca36abfb2487c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1906994
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Evan Green <evgreen@chromium.org>
Diffstat (limited to 'common/printf.c')
-rw-r--r-- | common/printf.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/common/printf.c b/common/printf.c index dd66d3630a..baac4addf7 100644 --- a/common/printf.c +++ b/common/printf.c @@ -270,8 +270,7 @@ int vfnprintf(int (*addchar)(void *context, int c), void *context, if (ptrspec == 'T' && !IS_ENABLED(NO_UINT64_SUPPORT)) { flags |= PF_64BIT; - /* NULL uses the current time. */ - if (ptrval == NULL) + if (ptrval == PRINTF_TIMESTAMP_NOW) v = get_time().val; else v = *(uint64_t *)ptrval; |