Skip to content

Commit 6e7ebee

Browse files
committed
Fixes for build warnings
1 parent 38a659d commit 6e7ebee

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

hal/filesystem.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ void hal_init(void)
3737
{
3838
return;
3939
}
40-
int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
40+
41+
int hal_flash_write(haladdr_t address, const uint8_t *data, int len)
4142
{
4243
(void)address;
4344
(void)data;
4445
(void)len;
4546
return -1;
4647
}
47-
int hal_flash_erase(uintptr_t address, int len)
48+
int hal_flash_erase(haladdr_t address, int len)
4849
{
4950
(void)address;
5051
(void)len;

hal/library_fs.c

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ static int cmd_get_state(uint8_t part)
6060
{
6161
uint8_t state;
6262
int ret;
63-
63+
6464
ret = wolfBoot_get_partition_state(part, &state);
6565
if (ret != 0) {
6666
wolfBoot_printf("Error: Failed to get state for %s partition (error: %d)\n",
6767
partition_name(part), ret);
6868
return -1;
6969
}
70-
70+
7171
wolfBoot_printf("%s partition state: %s (0x%02X)\n",
7272
partition_name(part), state_name(state), state);
7373
return 0;
@@ -77,15 +77,15 @@ static int cmd_get_state(uint8_t part)
7777
static int cmd_get_all_states(void)
7878
{
7979
int ret = 0;
80-
80+
8181
wolfBoot_printf("=== Partition States ===\n");
82-
82+
8383
if (cmd_get_state(PART_BOOT) != 0)
8484
ret = -1;
85-
85+
8686
if (cmd_get_state(PART_UPDATE) != 0)
8787
ret = -1;
88-
88+
8989
return ret;
9090
}
9191

@@ -164,15 +164,21 @@ static int cmd_verify(uint8_t part)
164164
int main(int argc, const char* argv[])
165165
{
166166
int ret = 0;
167-
167+
const char* prog_name = "lib-fs";
168+
const char* command;
169+
170+
if (argc >= 1) {
171+
prog_name = argv[0];
172+
}
173+
168174
/* Check for argument count */
169175
if (argc != 2) {
170-
print_usage(argv[0]);
176+
print_usage(prog_name);
171177
return 1;
172178
}
173-
174-
const char* command = argv[1];
175-
179+
180+
command = argv[1];
181+
176182
/* Process commands */
177183
if (strcmp(command, "status") == 0) {
178184
ret = cmd_get_all_states();
@@ -195,7 +201,7 @@ int main(int argc, const char* argv[])
195201
else if (strcmp(command, "verify-update") == 0) {
196202
ret = cmd_verify(PART_UPDATE);
197203
}
198-
else if (strcmp(command, "help") == 0 || strcmp(command, "--help") == 0 ||
204+
else if (strcmp(command, "help") == 0 || strcmp(command, "--help") == 0 ||
199205
strcmp(command, "-h") == 0) {
200206
print_usage(argv[0]);
201207
ret = 0;
@@ -205,6 +211,6 @@ int main(int argc, const char* argv[])
205211
print_usage(argv[0]);
206212
ret = 1;
207213
}
208-
214+
209215
return ret;
210216
}

include/printf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#if defined(WOLFBOOT_DEBUG_EFI) && !defined(PRINTF_ENABLED)
3131
# define PRINTF_ENABLED
3232
#endif
33-
#if defined(ARCH_SIM) && !defined(PRINTF_ENABLED)
33+
#if (defined(ARCH_SIM) || defined(__linux__)) && !defined(PRINTF_ENABLED)
3434
# define PRINTF_ENABLED
3535
#endif
3636

src/update_ram.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void RAMFUNCTION wolfBoot_start(void)
312312
dts_size = (uint32_t)os_image.fw_size;
313313

314314
wolfBoot_printf("Loading DTS (size %lu) to RAM at %08lx\n",
315-
dts_size, dts_addr);
315+
(long unsigned int)dts_size, (long unsigned int)dts_addr);
316316
ext_flash_check_read((uintptr_t)os_image.fw_base,
317317
(uint8_t*)dts_addr, dts_size);
318318
}
@@ -331,7 +331,7 @@ void RAMFUNCTION wolfBoot_start(void)
331331
uint8_t* dts_dst = (uint8_t*)WOLFBOOT_LOAD_DTS_ADDRESS;
332332
dts_size = (uint32_t)ret;
333333
wolfBoot_printf("Loading DTB (size %d) from %p to RAM at %p\n",
334-
dts_size, dts_addr, WOLFBOOT_LOAD_DTS_ADDRESS);
334+
dts_size, dts_addr, (void*)WOLFBOOT_LOAD_DTS_ADDRESS);
335335
memcpy(dts_dst, dts_addr, dts_size);
336336
dts_addr = dts_dst;
337337
}

0 commit comments

Comments
 (0)