This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7659

-- gerrit

commit d63a01f518ab89d9e69d8950bb75ee836fba143f
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Mon May 1 00:00:47 2023 +0200

    target: move in target_type.h the target_type's declaration
    
    The static analyser 'sparse' complains, while compiling a target's
    file, that the struct target_type is declared in the file as non
    static, but it is not exposed through an include file.
    The message is:
            warning: symbol 'XXX' was not declared. Should it be static?
    
    Move the list of target_type's declaration in target_type.h
    While there, fix a name clash in stm8.c
    
    Change-Id: Ia9c681e0825cfd04d509616dbc04a0cf4944f379
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/target/stm8.c b/src/target/stm8.c
index aa934c9bc9..9fd65091ce 100644
--- a/src/target/stm8.c
+++ b/src/target/stm8.c
@@ -542,12 +542,12 @@ static int stm8_get_core_reg(struct reg *reg)
        int retval;
        struct stm8_core_reg *stm8_reg = reg->arch_info;
        struct target *target = stm8_reg->target;
-       struct stm8_common *stm8_target = target_to_stm8(target);
+       struct stm8_common *stm8 = target_to_stm8(target);
 
        if (target->state != TARGET_HALTED)
                return ERROR_TARGET_NOT_HALTED;
 
-       retval = stm8_target->read_core_reg(target, stm8_reg->num);
+       retval = stm8->read_core_reg(target, stm8_reg->num);
 
        return retval;
 }
diff --git a/src/target/target.c b/src/target/target.c
index c55b67cc95..02ffa829a4 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -65,46 +65,6 @@ static int target_get_gdb_fileio_info_default(struct target 
*target,
 static int target_gdb_fileio_end_default(struct target *target, int retcode,
                int fileio_errno, bool ctrl_c);
 
-/* targets */
-extern struct target_type arm7tdmi_target;
-extern struct target_type arm720t_target;
-extern struct target_type arm9tdmi_target;
-extern struct target_type arm920t_target;
-extern struct target_type arm966e_target;
-extern struct target_type arm946e_target;
-extern struct target_type arm926ejs_target;
-extern struct target_type fa526_target;
-extern struct target_type feroceon_target;
-extern struct target_type dragonite_target;
-extern struct target_type xscale_target;
-extern struct target_type xtensa_chip_target;
-extern struct target_type cortexm_target;
-extern struct target_type cortexa_target;
-extern struct target_type aarch64_target;
-extern struct target_type cortexr4_target;
-extern struct target_type armv8r_target;
-extern struct target_type arm11_target;
-extern struct target_type ls1_sap_target;
-extern struct target_type mips_m4k_target;
-extern struct target_type mips_mips64_target;
-extern struct target_type avr_target;
-extern struct target_type dsp563xx_target;
-extern struct target_type dsp5680xx_target;
-extern struct target_type testee_target;
-extern struct target_type avr32_ap7k_target;
-extern struct target_type hla_target;
-extern struct target_type esp32_target;
-extern struct target_type esp32s2_target;
-extern struct target_type esp32s3_target;
-extern struct target_type or1k_target;
-extern struct target_type quark_x10xx_target;
-extern struct target_type quark_d20xx_target;
-extern struct target_type stm8_target;
-extern struct target_type riscv_target;
-extern struct target_type mem_ap_target;
-extern struct target_type esirisc_target;
-extern struct target_type arcv2_target;
-
 static struct target_type *target_types[] = {
        &arm7tdmi_target,
        &arm9tdmi_target,
diff --git a/src/target/target_type.h b/src/target/target_type.h
index 947080381c..5186e9c19b 100644
--- a/src/target/target_type.h
+++ b/src/target/target_type.h
@@ -311,4 +311,43 @@ struct target_type {
        unsigned int (*data_bits)(struct target *target);
 };
 
+extern struct target_type aarch64_target;
+extern struct target_type arcv2_target;
+extern struct target_type arm11_target;
+extern struct target_type arm720t_target;
+extern struct target_type arm7tdmi_target;
+extern struct target_type arm920t_target;
+extern struct target_type arm926ejs_target;
+extern struct target_type arm946e_target;
+extern struct target_type arm966e_target;
+extern struct target_type arm9tdmi_target;
+extern struct target_type armv8r_target;
+extern struct target_type avr32_ap7k_target;
+extern struct target_type avr_target;
+extern struct target_type cortexa_target;
+extern struct target_type cortexm_target;
+extern struct target_type cortexr4_target;
+extern struct target_type dragonite_target;
+extern struct target_type dsp563xx_target;
+extern struct target_type dsp5680xx_target;
+extern struct target_type esirisc_target;
+extern struct target_type esp32s2_target;
+extern struct target_type esp32s3_target;
+extern struct target_type esp32_target;
+extern struct target_type fa526_target;
+extern struct target_type feroceon_target;
+extern struct target_type hla_target;
+extern struct target_type ls1_sap_target;
+extern struct target_type mem_ap_target;
+extern struct target_type mips_m4k_target;
+extern struct target_type mips_mips64_target;
+extern struct target_type or1k_target;
+extern struct target_type quark_d20xx_target;
+extern struct target_type quark_x10xx_target;
+extern struct target_type riscv_target;
+extern struct target_type stm8_target;
+extern struct target_type testee_target;
+extern struct target_type xscale_target;
+extern struct target_type xtensa_chip_target;
+
 #endif /* OPENOCD_TARGET_TARGET_TYPE_H */

-- 

Reply via email to