Skip to content

Commit fb4d689

Browse files
committed
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 <[email protected]>
1 parent 2643e8d commit fb4d689

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

drivers/eeprom/eeprom_shell.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static int cmd_fill(const struct shell *shell, size_t argc, char **argv)
173173
return -EINVAL;
174174
}
175175

176-
shell_print(shell, "Writing %d bytes of 0x%02x to EEPROM...", len,
176+
shell_print(shell, "Writing %d bytes of 0x%02lx to EEPROM...", len,
177177
pattern);
178178

179179
addr = initial_offset;

drivers/hwinfo/hwinfo_shell.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ static int cmd_get_device_id(const struct shell *shell, size_t argc, char **argv
2222
shell_error(shell, "Not supported by hardware");
2323
return -ENOTSUP;
2424
} else if (length < 0) {
25-
shell_error(shell, "Error: %d", length);
25+
shell_error(shell, "Error: %zd", length);
2626
return length;
2727
}
2828

29-
shell_fprintf(shell, SHELL_NORMAL, "Length: %d\n", length);
29+
shell_fprintf(shell, SHELL_NORMAL, "Length: %zd\n", length);
3030
shell_fprintf(shell, SHELL_NORMAL, "ID: 0x");
3131

3232
for (i = 0 ; i < length ; i++) {

subsys/shell/modules/kernel_service.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ static void shell_tdata_dump(const struct k_thread *cthread, void *user_data)
104104
* targets.
105105
*/
106106
#ifdef CONFIG_64BIT
107-
shell_print(shell, "\tTotal execution cycles: %llu (%u %%)",
108-
rt_stats_thread.execution_cycles,
107+
shell_print(shell, "\tTotal execution cycles: %" PRIu64 " (%u %%)",
108+
(uint64_t)rt_stats_thread.execution_cycles,
109109
pcnt);
110110
#else
111111
shell_print(shell, "\tTotal execution cycles: %u (%u %%)",

subsys/stats/stats_shell.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static int stats_cb(struct stats_hdr *hdr, void *arg, const char *name, uint16_t
2525
val = *(uint64_t *)(addr);
2626
break;
2727
}
28-
shell_print(sh, "\t%s (offset: %u, addr: %p): %llu", name, off, addr, val);
28+
shell_print(sh, "\t%s (offset: %u, addr: %p): %" PRIu64, name, off, addr, val);
2929
return 0;
3030
}
3131

0 commit comments

Comments
 (0)