Skip to content

Commit

Permalink
target: make some functions static to fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sobuch committed Nov 4, 2024
1 parent 53d744b commit dac66ff
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions src/flash/nor/esp_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down Expand Up @@ -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!");
Expand Down Expand Up @@ -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!");
Expand Down Expand Up @@ -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;
Expand All @@ -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!");
Expand Down Expand Up @@ -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!");
Expand Down
20 changes: 10 additions & 10 deletions src/target/espressif/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/target/xtensa/xtensa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dac66ff

Please sign in to comment.