diff options
author | Evan Green <evgreen@chromium.org> | 2019-10-01 14:07:03 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-05 00:47:58 +0000 |
commit | e77ccb89c1b74a9ba3be47072d35e3e148d2a469 (patch) | |
tree | d229a873d4e2cb6916c55d955b1e9a971052aa2b /common | |
parent | 1519095feaa933996ee413c87fd67de39d16213b (diff) | |
download | chrome-ec-e77ccb89c1b74a9ba3be47072d35e3e148d2a469.tar.gz |
Remove uses of %l
This change removes uses of %l from the EC side of the EC codebase.
This is done because the semantics of %l within printf have changed,
and there are concerns that new calls to printf will be cherry-picked
into old firmware branches without the printf changes. So, in
preparation for disallowing %l in master, remove occurrences of %l.
This change was done by manually fixing up anything found under the EC
directory with the following regex: %[0-9*.-]*l[^l]
Remember that anything on the host machine is fine as-is, since the host
printf never changed.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=None
Change-Id: I2a97433ddab5bfb8a6031ca4ff1d3905289444e2
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1834603
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/bluetooth_le.c | 2 | ||||
-rw-r--r-- | common/motion_sense.c | 2 | ||||
-rw-r--r-- | common/panic_output.c | 4 | ||||
-rw-r--r-- | common/physical_presence.c | 2 | ||||
-rw-r--r-- | common/system.c | 6 | ||||
-rw-r--r-- | common/usbc/usb_sm.c | 5 |
6 files changed, 10 insertions, 11 deletions
diff --git a/common/bluetooth_le.c b/common/bluetooth_le.c index 94d006781d..2e68893223 100644 --- a/common/bluetooth_le.c +++ b/common/bluetooth_le.c @@ -139,7 +139,7 @@ static void mem_dump(uint8_t *mem, int len) for (i = 0; i < len; i++) { value = mem[i]; if (i % 8 == 0) - CPRINTF("\n%08lx: %02x", (unsigned long)&mem[i], value); + CPRINTF("\n%pP: %02x", &mem[i], value); else CPRINTF(" %02x", value); } diff --git a/common/motion_sense.c b/common/motion_sense.c index ef9cdef185..74f4120875 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -1709,7 +1709,7 @@ static int motion_sense_read_fifo(int argc, char **argv) MOTIONSENSE_SENSOR_FLAG_FLUSH)) { uint64_t timestamp; memcpy(×tamp, v.data, sizeof(v.data)); - ccprintf("Timestamp: 0x%016lx%s\n", timestamp, + ccprintf("Timestamp: 0x%016llx%s\n", timestamp, (v.flags & MOTIONSENSE_SENSOR_FLAG_FLUSH ? " - Flush" : "")); } else { diff --git a/common/panic_output.c b/common/panic_output.c index e8233d75cc..4c70b06679 100644 --- a/common/panic_output.c +++ b/common/panic_output.c @@ -194,12 +194,12 @@ static int command_crash(int argc, char **argv) volatile int zero = 0; cflush(); - ccprintf("%08lx", (long)1 / zero); + ccprintf("%08x", 1 / zero); } else if (!strcasecmp(argv[1], "udivzero")) { volatile int zero = 0; cflush(); - ccprintf("%08lx", (unsigned long)1 / zero); + ccprintf("%08x", 1 / zero); #ifdef CONFIG_CMD_STACKOVERFLOW } else if (!strcasecmp(argv[1], "stack")) { stack_overflow_recurse(1); diff --git a/common/physical_presence.c b/common/physical_presence.c index 8da7c8d360..5fa97e1218 100644 --- a/common/physical_presence.c +++ b/common/physical_presence.c @@ -298,7 +298,7 @@ static void pp_test_callback(void) static int command_ppresence(int argc, char **argv) { /* Print current status */ - ccprintf("PP state: %d, %d/%d, dt=%.6ld\n", + ccprintf("PP state: %d, %d/%d, dt=%.6lld\n", pp_detect_state, pp_press_count, pp_press_count_needed, get_time().val - pp_last_press); diff --git a/common/system.c b/common/system.c index 7b8b164ea5..88475c3a68 100644 --- a/common/system.c +++ b/common/system.c @@ -365,9 +365,9 @@ void system_disable_jump(void) */ ret = mpu_protect_data_ram(); if (ret == EC_SUCCESS) { - CPRINTS("data RAM locked. Exclusion %08lx-%08lx", - (unsigned long)&__iram_text_start, - (unsigned long)&__iram_text_end); + CPRINTS("data RAM locked. Exclusion %pP-%pP", + &__iram_text_start, + &__iram_text_end); } else { CPRINTS("Failed to lock data RAM (%d)", ret); return; diff --git a/common/usbc/usb_sm.c b/common/usbc/usb_sm.c index ce7c24b332..d0ca28e330 100644 --- a/common/usbc/usb_sm.c +++ b/common/usbc/usb_sm.c @@ -115,9 +115,8 @@ void set_state(const int port, struct sm_ctx *const ctx, * intended state to transition into. */ if (internal->exit) { - CPRINTF("C%d: Ignoring set state to 0x%08lx within 0x%08lx", - port, (unsigned long)new_state, - (unsigned long)ctx->current); + CPRINTF("C%d: Ignoring set state to 0x%pP within 0x%pP", + port, new_state, ctx->current); return; } |