shell: Fix various build issues with string formattors

We get a few different CI failures associated with data type
differences on various platforms.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2021-10-19 09:41:40 -05:00 committed by Kumar Gala
commit fb4d68973f
4 changed files with 6 additions and 6 deletions

View file

@ -173,7 +173,7 @@ static int cmd_fill(const struct shell *shell, size_t argc, char **argv)
return -EINVAL; return -EINVAL;
} }
shell_print(shell, "Writing %d bytes of 0x%02x to EEPROM...", len, shell_print(shell, "Writing %d bytes of 0x%02lx to EEPROM...", len,
pattern); pattern);
addr = initial_offset; addr = initial_offset;

View file

@ -22,11 +22,11 @@ static int cmd_get_device_id(const struct shell *shell, size_t argc, char **argv
shell_error(shell, "Not supported by hardware"); shell_error(shell, "Not supported by hardware");
return -ENOTSUP; return -ENOTSUP;
} else if (length < 0) { } else if (length < 0) {
shell_error(shell, "Error: %d", length); shell_error(shell, "Error: %zd", length);
return length; return length;
} }
shell_fprintf(shell, SHELL_NORMAL, "Length: %d\n", length); shell_fprintf(shell, SHELL_NORMAL, "Length: %zd\n", length);
shell_fprintf(shell, SHELL_NORMAL, "ID: 0x"); shell_fprintf(shell, SHELL_NORMAL, "ID: 0x");
for (i = 0 ; i < length ; i++) { for (i = 0 ; i < length ; i++) {

View file

@ -104,8 +104,8 @@ static void shell_tdata_dump(const struct k_thread *cthread, void *user_data)
* targets. * targets.
*/ */
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
shell_print(shell, "\tTotal execution cycles: %llu (%u %%)", shell_print(shell, "\tTotal execution cycles: %" PRIu64 " (%u %%)",
rt_stats_thread.execution_cycles, (uint64_t)rt_stats_thread.execution_cycles,
pcnt); pcnt);
#else #else
shell_print(shell, "\tTotal execution cycles: %u (%u %%)", shell_print(shell, "\tTotal execution cycles: %u (%u %%)",

View file

@ -25,7 +25,7 @@ static int stats_cb(struct stats_hdr *hdr, void *arg, const char *name, uint16_t
val = *(uint64_t *)(addr); val = *(uint64_t *)(addr);
break; break;
} }
shell_print(sh, "\t%s (offset: %u, addr: %p): %llu", name, off, addr, val); shell_print(sh, "\t%s (offset: %u, addr: %p): %" PRIu64, name, off, addr, val);
return 0; return 0;
} }