target: don't export local symbols
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 5 Sep 2022 23:28:09 +0000 (01:28 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Tue, 13 Sep 2022 22:13:58 +0000 (22:13 +0000)
Symbols that are not used outside the file should not be exported
and should be declared as static.

Change-Id: Icbe7f7bce287b903edec9dc9db3370722c51fbd5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7173
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/arm.h
src/target/arm946e.c
src/target/arm946e.h
src/target/armv4_5.c
src/target/dsp5680xx.c
src/target/dsp5680xx.h
src/target/mips32_pracc.c
src/target/mips32_pracc.h
src/target/mips_m4k.c
src/target/mips_m4k.h

index bcfa85c79c948cd522a922ea44b09ffec5c7eee2..de46ffb4b90b266fa042f26705e675450944714b 100644 (file)
@@ -310,7 +310,4 @@ void arm_set_cpsr(struct arm *arm, uint32_t cpsr);
 struct reg *arm_reg_current(struct arm *arm, unsigned regnum);
 struct reg *armv8_reg_current(struct arm *arm, unsigned regnum);
 
-extern struct reg arm_gdb_dummy_fp_reg;
-extern struct reg arm_gdb_dummy_fps_reg;
-
 #endif /* OPENOCD_TARGET_ARM_H */
index d2bccad22833c5d2934f09819d0b222590707c0f..3f8a8810555bf4cb2bf8b5af1c01040834850741 100644 (file)
@@ -44,7 +44,7 @@ static int arm946e_post_debug_entry(struct target *target);
 static void arm946e_pre_restore_context(struct target *target);
 static int arm946e_read_cp15(struct target *target, int reg_addr, uint32_t *value);
 
-int arm946e_init_arch_info(struct target *target,
+static int arm946e_init_arch_info(struct target *target,
        struct arm946e_common *arm946e,
        struct jtag_tap *tap)
 {
@@ -173,7 +173,7 @@ static int arm946e_read_cp15(struct target *target, int reg_addr, uint32_t *valu
        return ERROR_OK;
 }
 
-int arm946e_write_cp15(struct target *target, int reg_addr, uint32_t value)
+static int arm946e_write_cp15(struct target *target, int reg_addr, uint32_t value)
 {
        int retval = ERROR_OK;
        struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
@@ -720,7 +720,7 @@ static const struct command_registration arm946e_exec_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-const struct command_registration arm946e_command_handlers[] = {
+static const struct command_registration arm946e_command_handlers[] = {
        {
                .chain = arm9tdmi_command_handlers,
        },
index 7416878690f96339552541bf2f113e5abe5be6cc..0196c2b378e77351b84f98d1a3661d5266ac3bb6 100644 (file)
@@ -32,10 +32,4 @@ static inline struct arm946e_common *target_to_arm946(struct target *target)
                        arm7_9_common.arm);
 }
 
-int arm946e_init_arch_info(struct target *target,
-                          struct arm946e_common *arm946e, struct jtag_tap *tap);
-int arm946e_write_cp15(struct target *target, int reg_addr, uint32_t value);
-
-extern const struct command_registration arm946e_command_handlers[];
-
 #endif /* OPENOCD_TARGET_ARM946E_H */
index 321772699bdd710a169fd04f5e46c195b4d3f24e..66e276f16b408c40c7a0fcf7324f1ad003d0742f 100644 (file)
@@ -535,7 +535,7 @@ static struct reg_feature arm_gdb_dummy_fp_features = {
  * Modern ARM cores use Vector Floating Point (VFP), if they
  * have any floating point support.  VFP is not FPA-compatible.
  */
-struct reg arm_gdb_dummy_fp_reg = {
+static struct reg arm_gdb_dummy_fp_reg = {
        .name = "GDB dummy FPA register",
        .value = (uint8_t *) arm_gdb_dummy_fp_value,
        .valid = true,
@@ -552,7 +552,7 @@ static const uint8_t arm_gdb_dummy_fps_value[4];
  * Dummy FPA status registers are required to support GDB on ARM.
  * Register packets require an obsolete FPA status register.
  */
-struct reg arm_gdb_dummy_fps_reg = {
+static struct reg arm_gdb_dummy_fps_reg = {
        .name = "GDB dummy FPA status register",
        .value = (uint8_t *) arm_gdb_dummy_fps_value,
        .valid = true,
index 621caaf37a0b7a70950b32a5296f19a1d08bd446..9a6e8dbe773138c2c7b620c298f8b8e7da6dea14 100644 (file)
@@ -16,7 +16,7 @@
 #include "target_type.h"
 #include "dsp5680xx.h"
 
-struct dsp5680xx_common dsp5680xx_context;
+static struct dsp5680xx_common dsp5680xx_context;
 
 #define _E "DSP5680XX_ERROR:%d\nAt:%s:%d:%s"
 #define err_check(r, c, m) if (r != ERROR_OK) {LOG_ERROR(_E, c, __func__, __LINE__, m); return r; }
index 3c03ac2695d4bdf9bbc847a634219f4bae68bea9..152f446977dab176e957b4611ccfc0abedfba3e1 100644 (file)
@@ -278,8 +278,6 @@ struct dsp5680xx_common {
        bool debug_mode_enabled;
 };
 
-extern struct dsp5680xx_common dsp5680xx_context;
-
 static inline struct dsp5680xx_common *target_to_dsp5680xx(struct target
                                                           *target)
 {
index 79d929c548021a5528b5dfc42e8321e02c0aff7b..9f5840e550c1c10e7467383be2f5da14bfd2c3a7 100644 (file)
@@ -150,7 +150,7 @@ static int mips32_pracc_clean_text_jump(struct mips_ejtag *ejtag_info)
        return ERROR_OK;
 }
 
-int mips32_pracc_exec(struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx,
+static int mips32_pracc_exec(struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx,
                                        uint32_t *param_out, bool check_last)
 {
        int code_count = 0;
@@ -323,7 +323,7 @@ void pracc_add(struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr)
                ctx->store_count++;
 }
 
-void pracc_add_li32(struct pracc_queue_info *ctx, uint32_t reg_num, uint32_t data, bool optimize)
+static void pracc_add_li32(struct pracc_queue_info *ctx, uint32_t reg_num, uint32_t data, bool optimize)
 {
        if (LOWER16(data) == 0 && optimize)
                pracc_add(ctx, 0, MIPS32_LUI(ctx->isa, reg_num, UPPER16(data)));        /* load only upper value */
index a736e668a42637a2dd1103c5491574bf8b50c699..1b00768676bc2485ac0c99c727cbdf65b395e70f 100644 (file)
@@ -53,7 +53,6 @@ struct pracc_queue_info {
 
 void pracc_queue_init(struct pracc_queue_info *ctx);
 void pracc_add(struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr);
-void pracc_add_li32(struct pracc_queue_info *ctx, uint32_t reg_num, uint32_t data, bool optimize);
 void pracc_queue_free(struct pracc_queue_info *ctx);
 int mips32_pracc_queue_exec(struct mips_ejtag *ejtag_info,
                            struct pracc_queue_info *ctx, uint32_t *buf, bool check_last);
@@ -68,9 +67,6 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are
 int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs);
 int mips32_pracc_write_regs(struct mips_ejtag *ejtag_info, uint32_t *regs);
 
-int mips32_pracc_exec(struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx,
-                               uint32_t *param_out, bool check_last);
-
 /**
  * \b mips32_cp0_read
  *
index 8d13447a09d480938b14dd08c56696b6a7c0c11e..2475702899e14ec4dd564859c97694d77bb80891 100644 (file)
@@ -1357,7 +1357,7 @@ static const struct command_registration mips_m4k_exec_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-const struct command_registration mips_m4k_command_handlers[] = {
+static const struct command_registration mips_m4k_command_handlers[] = {
        {
                .chain = mips32_command_handlers,
        },
index 8026de23287fd5c23f86dd4a7054efd59c653e1d..f63d72f73cc189171ec4322904ae5bb355eb4846 100644 (file)
@@ -43,6 +43,5 @@ static inline void mips_m4k_isa_filter(enum mips32_isa_imp isa_imp, target_addr_
                }
        }
 }
-extern const struct command_registration mips_m4k_command_handlers[];
 
 #endif /* OPENOCD_TARGET_MIPS_M4K_H */