target/mips32: fix clang sbuild check fail

Initialized `value` variables that could only be set in a branch.

Change-Id: Iec7413ade9d053c93352a58ff954ad49a6545923
Signed-off-by: Walter Ji <walter.ji@oss.cipunited.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8179
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Walter Ji 2024-03-18 17:24:51 +08:00 committed by Antonio Borneo
parent 79b51fedab
commit 47d983a77a
1 changed files with 2 additions and 2 deletions

View File

@ -2109,7 +2109,7 @@ static int mips32_dsp_find_register_by_name(const char *reg_name)
*/ */
static int mips32_dsp_get_all_regs(struct command_invocation *cmd, struct mips_ejtag *ejtag_info) static int mips32_dsp_get_all_regs(struct command_invocation *cmd, struct mips_ejtag *ejtag_info)
{ {
uint32_t value; uint32_t value = 0;
for (int i = 0; i < MIPS32NUMDSPREGS; i++) { for (int i = 0; i < MIPS32NUMDSPREGS; i++) {
int retval = mips32_pracc_read_dsp_reg(ejtag_info, &value, i); int retval = mips32_pracc_read_dsp_reg(ejtag_info, &value, i);
if (retval != ERROR_OK) { if (retval != ERROR_OK) {
@ -2134,7 +2134,7 @@ static int mips32_dsp_get_all_regs(struct command_invocation *cmd, struct mips_e
*/ */
static int mips32_dsp_get_register(struct command_invocation *cmd, struct mips_ejtag *ejtag_info) static int mips32_dsp_get_register(struct command_invocation *cmd, struct mips_ejtag *ejtag_info)
{ {
uint32_t value; uint32_t value = 0;
int index = mips32_dsp_find_register_by_name(CMD_ARGV[0]); int index = mips32_dsp_find_register_by_name(CMD_ARGV[0]);
if (index == MIPS32NUMDSPREGS) { if (index == MIPS32NUMDSPREGS) {
command_print(CMD, "ERROR: register '%s' not found", CMD_ARGV[0]); command_print(CMD, "ERROR: register '%s' not found", CMD_ARGV[0]);