From dac66ff821dfb435d8cbdbf9d154bb9313925670 Mon Sep 17 00:00:00 2001 From: Samuel Obuch Date: Fri, 1 Nov 2024 10:41:51 +0100 Subject: [PATCH] target: make some functions static to fix warnings --- src/flash/nor/esp_flash.c | 12 ++++++------ src/target/espressif/esp.c | 20 ++++++++++---------- src/target/xtensa/xtensa.c | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/flash/nor/esp_flash.c b/src/flash/nor/esp_flash.c index 393867dc56..1543d4dbbb 100644 --- a/src/flash/nor/esp_flash.c +++ b/src/flash/nor/esp_flash.c @@ -1477,7 +1477,7 @@ static int esp_algo_flash_appimage_base_update(struct target *target, return retval; } -COMMAND_HELPER(esp_algo_flash_cmd_appimage_flashoff_do, struct target *target) +static COMMAND_HELPER(esp_algo_flash_cmd_appimage_flashoff_do, struct target *target) { if (CMD_ARGC != 1) { command_print(CMD, "Flash offset not specified!"); @@ -1520,7 +1520,7 @@ static int esp_algo_flash_set_compression(struct target *target, return ERROR_OK; } -COMMAND_HELPER(esp_algo_flash_cmd_set_compression, struct target *target) +static COMMAND_HELPER(esp_algo_flash_cmd_set_compression, struct target *target) { if (CMD_ARGC != 1) { command_print(CMD, "Compression not specified!"); @@ -1569,7 +1569,7 @@ static int esp_algo_flash_set_stub_log(struct target *target, char *bank_name_su return ERROR_OK; } -COMMAND_HELPER(esp_algo_flash_cmd_set_encryption, struct target *target) +static COMMAND_HELPER(esp_algo_flash_cmd_set_encryption, struct target *target) { if (CMD_ARGC != 1) { command_print(CMD, "Encryption not specified!"); @@ -1673,7 +1673,7 @@ static int esp_flash_verify_bank_hash(struct target *target, return differ ? ERROR_FAIL : ERROR_OK; } -COMMAND_HELPER(esp_algo_flash_parse_cmd_verify_bank_hash, struct target *target) +static COMMAND_HELPER(esp_algo_flash_parse_cmd_verify_bank_hash, struct target *target) { if (CMD_ARGC < 2 || CMD_ARGC > 3) return ERROR_COMMAND_SYNTAX_ERROR; @@ -1686,7 +1686,7 @@ COMMAND_HELPER(esp_algo_flash_parse_cmd_verify_bank_hash, struct target *target) return esp_flash_verify_bank_hash(target, offset, CMD_ARGV[1]); } -COMMAND_HELPER(esp_algo_flash_parse_cmd_clock_boost, struct target *target) +static COMMAND_HELPER(esp_algo_flash_parse_cmd_clock_boost, struct target *target) { if (CMD_ARGC != 1) { command_print(CMD, "Clock boost flag not specified!"); @@ -1714,7 +1714,7 @@ COMMAND_HELPER(esp_algo_flash_parse_cmd_clock_boost, struct target *target) return esp_algo_flash_boost_clock_freq(bank, boost); } -COMMAND_HELPER(esp_algo_flash_parse_cmd_stub_log, struct target *target) +static COMMAND_HELPER(esp_algo_flash_parse_cmd_stub_log, struct target *target) { if (CMD_ARGC != 1) { LOG_TARGET_ERROR(target, "Stub log flag not specified!"); diff --git a/src/target/espressif/esp.c b/src/target/espressif/esp.c index 2f72b20c2b..0746ae0ae7 100644 --- a/src/target/espressif/esp.c +++ b/src/target/espressif/esp.c @@ -130,7 +130,7 @@ struct target *esp_common_get_halted_target(struct target *target, int32_t corei return target; } -void esp_common_dump_bp_slot(const char *caption, struct esp_flash_breakpoints *bps, size_t slot) +static void esp_common_dump_bp_slot(const char *caption, struct esp_flash_breakpoints *bps, size_t slot) { if (!LOG_LEVEL_IS(LOG_LVL_DEBUG)) return; @@ -174,7 +174,7 @@ static int esp_common_flash_breakpoints_clear(struct target *target) return ERROR_OK; } -bool esp_common_any_pending_flash_breakpoint(struct esp_common *esp) +static bool esp_common_any_pending_flash_breakpoint(struct esp_common *esp) { for (uint32_t slot = 0; slot < ESP_FLASH_BREAKPOINTS_MAX_NUM; slot++) { if (esp->flash_brps.brps[slot].status == ESP_BP_STAT_PEND) @@ -183,7 +183,7 @@ bool esp_common_any_pending_flash_breakpoint(struct esp_common *esp) return false; } -bool esp_common_any_added_flash_breakpoint(struct esp_common *esp) +static bool esp_common_any_added_flash_breakpoint(struct esp_common *esp) { for (uint32_t slot = 0; slot < ESP_FLASH_BREAKPOINTS_MAX_NUM; slot++) { if (esp->flash_brps.brps[slot].insn_sz > 0) @@ -192,7 +192,7 @@ bool esp_common_any_added_flash_breakpoint(struct esp_common *esp) return false; } -void esp_common_flash_breakpoints_get_ready_to_remove(struct esp_common *esp) +static void esp_common_flash_breakpoints_get_ready_to_remove(struct esp_common *esp) { for (uint32_t slot = 0; slot < ESP_FLASH_BREAKPOINTS_MAX_NUM; slot++) { if (esp->flash_brps.brps[slot].insn_sz > 0) { @@ -287,7 +287,7 @@ int esp_common_flash_breakpoint_remove(struct target *target, struct esp_common return esp->flash_brps.ops->breakpoint_remove(target, &esp->flash_brps.brps[slot], 1); } -int esp_common_process_lazy_flash_breakpoints(struct target *target) +static int esp_common_process_lazy_flash_breakpoints(struct target *target) { struct esp_common *esp = target_to_esp_common(target); struct esp_flash_breakpoint *flash_bps = esp->flash_brps.brps; @@ -346,7 +346,7 @@ int esp_common_process_lazy_flash_breakpoints(struct target *target) return ret; } -int esp_common_halt_target(struct target *target, enum target_state *old_state) +static int esp_common_halt_target(struct target *target, enum target_state *old_state) { *old_state = target->state; if (target->state != TARGET_HALTED) { @@ -400,7 +400,7 @@ int esp_common_handle_gdb_detach(struct target *target) return ERROR_OK; } -int esp_common_handle_flash_breakpoints(struct target *target) +static int esp_common_handle_flash_breakpoints(struct target *target) { struct esp_common *esp = target_to_esp_common(target); @@ -488,7 +488,7 @@ int esp_common_read_pseudo_ex_reason(struct target *target) /* Generic commands for xtensa and riscv */ -int esp_common_gdb_detach_handler(struct target *target) +static int esp_common_gdb_detach_handler(struct target *target) { if (target->smp) { struct target_list *head; @@ -502,7 +502,7 @@ int esp_common_gdb_detach_handler(struct target *target) return esp_common_handle_gdb_detach(target); } -int esp_common_process_flash_breakpoints_handler(struct target *target) +static int esp_common_process_flash_breakpoints_handler(struct target *target) { if (target->smp) { struct target_list *head; @@ -516,7 +516,7 @@ int esp_common_process_flash_breakpoints_handler(struct target *target) return esp_common_handle_flash_breakpoints(target); } -int esp_common_disable_lazy_breakpoints_handler(struct target *target) +static int esp_common_disable_lazy_breakpoints_handler(struct target *target) { /* Before disabling, add/remove pending breakpoints */ int ret = esp_common_process_flash_breakpoints_handler(target); diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c index dd2eaa688a..21aee85852 100644 --- a/src/target/xtensa/xtensa.c +++ b/src/target/xtensa/xtensa.c @@ -4277,7 +4277,7 @@ COMMAND_HANDLER(xtensa_cmd_smpbreak) get_current_target(CMD_CTX)); } -COMMAND_HELPER(xtensa_cmd_dm_rw_do, struct xtensa *xtensa) +static COMMAND_HELPER(xtensa_cmd_dm_rw_do, struct xtensa *xtensa) { if (CMD_ARGC == 1) { // read: xtensa dm addr