target: make local symbols static 68/7168/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 5 Sep 2022 21:56:18 +0000 (23:56 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Tue, 13 Sep 2022 22:11:46 +0000 (22:11 +0000)
Symbols that are not exported should be declared as static.

Change-Id: I2475524f4c14520e3163572560f4a9f276356ed5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7168
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/aarch64.c
src/target/arc.c
src/target/arc_cmd.c
src/target/breakpoints.c
src/target/cortex_m.c
src/target/mem_ap.c

index 20e212e2b31bf22049d4c6c50daadf113ef666ce..8b0cf3b631d9d74096a01fb59bab62349b1a4f79 100644 (file)
@@ -1837,7 +1837,7 @@ static int aarch64_remove_watchpoint(struct target *target,
  * find out which watchpoint hits
  * get exception address and compare the address to watchpoints
  */
-int aarch64_hit_watchpoint(struct target *target,
+static int aarch64_hit_watchpoint(struct target *target,
        struct watchpoint **hit_watchpoint)
 {
        if (target->debug_reason != DBG_REASON_WATCHPOINT)
index 63de3f93016ebb8a3c0ba2a069698bd53c9af0a1..2761bfa800ad7bfe768f474a298194d286d59e00 100644 (file)
@@ -93,7 +93,7 @@ struct reg *arc_reg_get_by_name(struct reg_cache *first,
  *
  * @param target Target for which to reset caches states.
  */
-int arc_reset_caches_states(struct target *target)
+static int arc_reset_caches_states(struct target *target)
 {
        struct arc_common *arc = target_to_arc(target);
 
@@ -283,7 +283,7 @@ static int arc_set_register(struct reg *reg, uint8_t *buf)
        return ERROR_OK;
 }
 
-const struct reg_arch_type arc_reg_type = {
+static const struct reg_arch_type arc_reg_type = {
        .get = arc_get_register,
        .set = arc_set_register,
 };
@@ -1401,7 +1401,7 @@ static int arc_target_create(struct target *target, Jim_Interp *interp)
  * little endian, so different type of conversion should be done.
  * Middle endian: instruction "aabbccdd", stored as "bbaaddcc"
  */
-int arc_write_instruction_u32(struct target *target, uint32_t address,
+static int arc_write_instruction_u32(struct target *target, uint32_t address,
        uint32_t instr)
 {
        uint8_t value_buf[4];
@@ -1428,7 +1428,7 @@ int arc_write_instruction_u32(struct target *target, uint32_t address,
  * case of little endian ARC instructions are in middle endian format, so
  * different type of conversion should be done.
  */
-int arc_read_instruction_u32(struct target *target, uint32_t address,
+static int arc_read_instruction_u32(struct target *target, uint32_t address,
                uint32_t *value)
 {
        uint8_t value_buf[4];
@@ -1694,7 +1694,7 @@ static int arc_remove_breakpoint(struct target *target,
        return ERROR_OK;
 }
 
-void arc_reset_actionpoints(struct target *target)
+static void arc_reset_actionpoints(struct target *target)
 {
        struct arc_common *arc = target_to_arc(target);
        struct arc_actionpoint *ap_list = arc->actionpoints_list;
@@ -1965,7 +1965,7 @@ static int arc_hit_watchpoint(struct target *target, struct watchpoint **hit_wat
 
 /* Helper function which switches core to single_step mode by
  * doing aux r/w operations.  */
-int arc_config_step(struct target *target, int enable_step)
+static int arc_config_step(struct target *target, int enable_step)
 {
        uint32_t value;
 
@@ -2001,7 +2001,7 @@ int arc_config_step(struct target *target, int enable_step)
        return ERROR_OK;
 }
 
-int arc_step(struct target *target, int current, target_addr_t address,
+static int arc_step(struct target *target, int current, target_addr_t address,
        int handle_breakpoints)
 {
        /* get pointers to arch-specific information */
@@ -2165,7 +2165,7 @@ int arc_cache_invalidate(struct target *target)
  * values directly from memory, bypassing cache, so if there are unflushed
  * lines debugger will read invalid values, which will cause a lot of troubles.
  * */
-int arc_dcache_flush(struct target *target)
+static int arc_dcache_flush(struct target *target)
 {
        uint32_t value, dc_ctrl_value;
        bool has_to_set_dc_ctrl_im;
index 8c859f2d4d06b6721f3166b8cfe9c0f9c3af00e1..5b99cffd75a3fb5a54264cf3a9962561b8865d88 100644 (file)
@@ -975,7 +975,7 @@ static int jim_handle_actionpoints_num(Jim_Interp *interp, int argc,
 
 /* ----- Exported target commands ------------------------------------------ */
 
-const struct command_registration arc_l2_cache_group_handlers[] = {
+static const struct command_registration arc_l2_cache_group_handlers[] = {
        {
                .name = "auto",
                .handler = arc_l2_cache_disable_auto_cmd,
@@ -986,7 +986,7 @@ const struct command_registration arc_l2_cache_group_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-const struct command_registration arc_cache_group_handlers[] = {
+static const struct command_registration arc_cache_group_handlers[] = {
        {
                .name = "auto",
                .handler = arc_l1_cache_disable_auto_cmd,
index b03136786390b7b2925e05701d4e7e502e2e9c93..2653cbd7b8b7c4f9715b1c52e7b2043932100b98 100644 (file)
@@ -392,7 +392,7 @@ struct breakpoint *breakpoint_find(struct target *target, target_addr_t address)
        return NULL;
 }
 
-int watchpoint_add_internal(struct target *target, target_addr_t address,
+static int watchpoint_add_internal(struct target *target, target_addr_t address,
                uint32_t length, enum watchpoint_rw rw, uint32_t value, uint32_t mask)
 {
        struct watchpoint *watchpoint = target->watchpoints;
@@ -500,7 +500,7 @@ static void watchpoint_free(struct target *target, struct watchpoint *watchpoint
        free(watchpoint);
 }
 
-int watchpoint_remove_internal(struct target *target, target_addr_t address)
+static int watchpoint_remove_internal(struct target *target, target_addr_t address)
 {
        struct watchpoint *watchpoint = target->watchpoints;
 
index 8e9264b79ce5604eca3e71e2fd25a873eea9d115..d0c6376a120f7294a146108a32040abff6092d6c 100644 (file)
@@ -1914,7 +1914,7 @@ int cortex_m_remove_watchpoint(struct target *target, struct watchpoint *watchpo
        return ERROR_OK;
 }
 
-int cortex_m_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
+static int cortex_m_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
 {
        if (target->debug_reason != DBG_REASON_WATCHPOINT)
                return ERROR_FAIL;
index 29229588b05f48165d97bb39d6e5444d01fd9ec3..08a188324a368945ffae7f69b33bb52202d0ac5e 100644 (file)
@@ -185,7 +185,7 @@ static struct reg_arch_type mem_ap_reg_arch_type = {
        .set = mem_ap_reg_set,
 };
 
-const char *mem_ap_get_gdb_arch(struct target *target)
+static const char *mem_ap_get_gdb_arch(struct target *target)
 {
        return "arm";
 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)