Skip to content

Commit fd14236

Browse files
sslupskycarlescufi
authored andcommitted
storage: flash_map: fix incomplete type
A pointer is not properly declared properly which causes the build to fail. flash_map_shell.c and flash_map.h do not include device.h so the device struct has an incomplete type hence the build error. Including device.h resolves the problem. Also fixes a Wformat warning when referencing fa_off which is a pointer. Cast the pointer to an uint32_t. Fixes #48722 Signed-off-by: Steven Slupsky <[email protected]>
1 parent 9a7e4b1 commit fd14236

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/storage/flash_map/flash_map_shell.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <ctype.h>
1313
#include <zephyr/storage/flash_map.h>
1414
#include <zephyr/logging/log.h>
15+
#include <zephyr/device.h>
1516

1617
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
1718

@@ -25,7 +26,7 @@ static void fa_cb(const struct flash_area *fa, void *user_data)
2526

2627
shell_print(shell, "%-4d %-8d %-20s 0x%-10x 0x%-12x",
2728
fa->fa_id, fa->fa_device_id, fa->fa_dev->name,
28-
fa->fa_off, fa->fa_size);
29+
(uint32_t) fa->fa_off, fa->fa_size);
2930
}
3031

3132
static int cmd_flash_map_list(const struct shell *shell, size_t argc,

0 commit comments

Comments
 (0)