From: openocd-gerrit <ope...@us...> - 2024-01-13 14:46:32
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via c47d77780cdaeac241e3be5d4433c7e4c8b475b9 (commit) from 53811fc584dc8837546be9ac17b77fdf8ad1e8bd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c47d77780cdaeac241e3be5d4433c7e4c8b475b9 Author: Antonio Borneo <bor...@gm...> Date: Sat Jan 6 17:54:24 2024 +0100 target/mips32: fix false positive from clang clang build triggers an error for an uninitialized value of the variable 'instr'. This is a false positive, as the macro #define MIPS32_CONFIG3_ISA_MASK (3 << MIPS32_CONFIG3_ISA_SHIFT) guarantees the switch/case already covers all the possible values with cases 0, 1, 2 and 3. Silent clang by adding a useless default case to the switch. While there, fix the indentation of the switch/case accordingly to OpenOCD coding style. Change-Id: I0ae316754ce7d091dd8366bf314b8e6ee780e313 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 7de4b1202d50 ("target/mips32: add cpu info detection") Reviewed-on: https://review.openocd.org/c/openocd/+/8065 Tested-by: jenkins Reviewed-by: Oleksij Rempel <li...@re...> diff --git a/src/target/mips32.c b/src/target/mips32.c index 8a3ddbf0b..5b94e6c89 100644 --- a/src/target/mips32.c +++ b/src/target/mips32.c @@ -1607,17 +1607,18 @@ COMMAND_HANDLER(mips32_handle_cpuinfo_command) char *instr; switch ((config3 & MIPS32_CONFIG3_ISA_MASK) >> MIPS32_CONFIG3_ISA_SHIFT) { - case 0: - instr = "MIPS32"; + case 0: + instr = "MIPS32"; break; - case 1: - instr = "microMIPS"; + case 1: + instr = "microMIPS"; break; - case 2: - instr = "MIPS32 (at reset) and microMIPS"; + case 2: + instr = "MIPS32 (at reset) and microMIPS"; break; - case 3: - instr = "microMIPS (at reset) and MIPS32"; + case 3: + default: + instr = "microMIPS (at reset) and MIPS32"; break; } ----------------------------------------------------------------------- Summary of changes: src/target/mips32.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) hooks/post-receive -- Main OpenOCD repository |