summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorEvan Green <evgreen@chromium.org>2019-09-23 13:07:06 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-05 00:47:48 +0000
commit0c2d7b648e1ea433aad8123538632d4edff6eb85 (patch)
tree32b535dd6284c9008817a641b728a6784fdceb0c /core
parent3564b23531fc1814924f39e7ac97751d758c14db (diff)
downloadchrome-ec-0c2d7b648e1ea433aad8123538632d4edff6eb85.tar.gz
printf: Convert %l to %ll
In order to make our printf more standard, utilize %ll for long long arguments, rather than %l. This does cost a little bit in flash space for that extra l in a couple of places, but enables us to turn on compile-time printf format checking. For this commit only, the semantics are such that both %l and %ll take 64-bit arguments. In the next commit, %l goes to its correct behavior of taking a sizeof(long) argument. BUG=chromium:984041 TEST=make -j buildall BRANCH=none Cq-Depend:chrome-internal:1863686,chrome-internal:1860161,chrome-internal:1914029 Change-Id: I18081b55a8dbf5ef8ec15fc499ca75e59d31da58 Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819652 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/task.c8
-rw-r--r--core/cortex-m0/task.c8
-rw-r--r--core/minute-ia/task.c11
-rw-r--r--core/nds32/task.c8
4 files changed, 18 insertions, 17 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index b9f9738e67..98fa84452f 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -933,7 +933,7 @@ void task_print_list(void)
sp++)
stackused -= sizeof(uint32_t);
- ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d\n", i, is_ready,
+ ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n", i, is_ready,
task_names[i], tasks[i].events, tasks[i].runtime,
stackused, tasks_init[i].stack_size);
cflush();
@@ -961,10 +961,10 @@ int command_task_info(int argc, char **argv)
ccprintf("Service calls: %11d\n", svc_calls);
ccprintf("Total exceptions: %11d\n", total + svc_calls);
ccprintf("Task switches: %11d\n", task_switches);
- ccprintf("Task switching started: %11.6ld s\n", task_start_time);
- ccprintf("Time in tasks: %11.6ld s\n",
+ ccprintf("Task switching started: %11.6lld s\n", task_start_time);
+ ccprintf("Time in tasks: %11.6lld s\n",
get_time().val - task_start_time);
- ccprintf("Time in exceptions: %11.6ld s\n", exc_total_time);
+ ccprintf("Time in exceptions: %11.6lld s\n", exc_total_time);
#endif
return EC_SUCCESS;
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index d9f0e85c40..ead2bff49f 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -566,7 +566,7 @@ void task_print_list(void)
sp++)
stackused -= sizeof(uint32_t);
- ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d\n", i, is_ready,
+ ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n", i, is_ready,
task_names[i], tasks[i].events, tasks[i].runtime,
stackused, tasks_init[i].stack_size);
cflush();
@@ -594,10 +594,10 @@ int command_task_info(int argc, char **argv)
ccprintf("Service calls: %11d\n", svc_calls);
ccprintf("Total exceptions: %11d\n", total + svc_calls);
ccprintf("Task switches: %11d\n", task_switches);
- ccprintf("Task switching started: %11.6ld s\n", task_start_time);
- ccprintf("Time in tasks: %11.6ld s\n",
+ ccprintf("Task switching started: %11.6lld s\n", task_start_time);
+ ccprintf("Time in tasks: %11.6lld s\n",
get_time().val - task_start_time);
- ccprintf("Time in exceptions: %11.6ld s\n", exc_total_time);
+ ccprintf("Time in exceptions: %11.6lld s\n", exc_total_time);
#endif
return EC_SUCCESS;
diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c
index 5675d32992..6628e41daa 100644
--- a/core/minute-ia/task.c
+++ b/core/minute-ia/task.c
@@ -528,12 +528,12 @@ void task_print_list(void)
if (IS_ENABLED(CONFIG_FPU)) {
char use_fpu = tasks[i].use_fpu ? 'Y' : 'N';
- ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d %c\n",
+ ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d %c\n",
i, is_ready, task_get_name(i), tasks[i].events,
tasks[i].runtime, stackused,
tasks_init[i].stack_size, use_fpu);
} else {
- ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d\n",
+ ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n",
i, is_ready, task_get_name(i), tasks[i].events,
tasks[i].runtime, stackused,
tasks_init[i].stack_size);
@@ -562,11 +562,12 @@ int command_task_info(int argc, char **argv)
ccprintf("Service calls: %11d\n", svc_calls);
ccprintf("Total exceptions: %11d\n", total + svc_calls);
ccprintf("Task switches: %11d\n", task_switches);
- ccprintf("Task switching started: %11.6ld s\n",
+ ccprintf("Task switching started: %11.6lld s\n",
task_start_time);
- ccprintf("Time in tasks: %11.6ld s\n",
+ ccprintf("Time in tasks: %11.6lld s\n",
get_time().val - task_start_time);
- ccprintf("Time in exceptions: %11.6ld s\n", exc_total_time);
+ ccprintf("Time in exceptions: %11.6lld s\n",
+ exc_total_time);
}
return EC_SUCCESS;
diff --git a/core/nds32/task.c b/core/nds32/task.c
index 389b20ba38..f86ef61ea1 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -696,7 +696,7 @@ void task_print_list(void)
sp++)
stackused -= sizeof(uint32_t);
- ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d\n", i, is_ready,
+ ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n", i, is_ready,
task_names[i], tasks[i].events, tasks[i].runtime,
stackused, tasks_init[i].stack_size);
cflush();
@@ -725,10 +725,10 @@ int command_task_info(int argc, char **argv)
ccprintf("Service calls: %11d\n", svc_calls);
ccprintf("Total exceptions: %11d\n", total + svc_calls);
ccprintf("Task switches: %11d\n", task_switches);
- ccprintf("Task switching started: %11.6ld s\n", task_start_time);
- ccprintf("Time in tasks: %11.6ld s\n",
+ ccprintf("Task switching started: %11.6lld s\n", task_start_time);
+ ccprintf("Time in tasks: %11.6lld s\n",
get_time().val - task_start_time);
- ccprintf("Time in exceptions: %11.6ld s\n", exc_total_time);
+ ccprintf("Time in exceptions: %11.6lld s\n", exc_total_time);
#endif
return EC_SUCCESS;