diff options
author | Evan Green <evgreen@chromium.org> | 2019-08-01 16:04:42 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-05 00:47:33 +0000 |
commit | a41fea6b7df1c83072140c0da9e07f09a8b032e4 (patch) | |
tree | 283880db1385c93420de304b410a3bccafa90971 /common/btle_hci_controller.c | |
parent | 4a29d2ecf4392cb995548e8f174cc85bac8361c1 (diff) | |
download | chrome-ec-a41fea6b7df1c83072140c0da9e07f09a8b032e4.tar.gz |
printf: Fix up %p to %pP
In order to avoid landmines later with future extensions to %p,
disallow %p by itself. The danger is that we'll have something
like: printf("%pFOO", myptr), and then later will add a %pF
extension, but miss this printf (maybe the string is split, maybe
it's just missed).
Missing a conversion during extension is worse than just seeing a
print like <ptr_val>OO, since %pF likely reaches through the
pointer and interprets its contents according to whatever F means.
Convert existing uses of %p to %pP, so they're explicitly printing
a pointer value, giving us flexibility to extend in the future.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=None
Cq-Depend:chrome-internal:1560879
Change-Id: I36a4bee8d41cb9a6139171f8de0d8f2f19468132
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1730604
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'common/btle_hci_controller.c')
-rw-r--r-- | common/btle_hci_controller.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/btle_hci_controller.c b/common/btle_hci_controller.c index 3d4076b073..903e9d5624 100644 --- a/common/btle_hci_controller.c +++ b/common/btle_hci_controller.c @@ -503,7 +503,7 @@ static int command_ble_hci_cmd(int argc, char **argv) hci_cmd(hci_buf); - CPRINTS("hci cmd @%p", hci_buf); + CPRINTS("hci cmd @%pP", hci_buf); return EC_SUCCESS; } @@ -543,7 +543,7 @@ static int command_hcitool(int argc, char **argv) hci_cmd(hci_buf); - CPRINTS("hci cmd @%p", hci_buf); + CPRINTS("hci cmd @%pP", hci_buf); return EC_SUCCESS; } @@ -588,7 +588,7 @@ static int command_ble_hci_acl(int argc, char **argv) hci_cmd(hci_buf); - CPRINTS("hci acl @%p", hci_buf); + CPRINTS("hci acl @%pP", hci_buf); return EC_SUCCESS; } |