aboutsummaryrefslogtreecommitdiff
path: root/src/svf
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2019-05-06 00:03:03 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2020-05-09 14:39:05 +0100
commit9b29cb58acbd14ed831d68fce4d6e6a1728f8caf (patch)
tree76ba767e4074f82fb6ba90510086c2be9d5e00a4 /src/svf
parent5df5e89cf3caf02dc6f49a5d3c8aa8b1349a1dbf (diff)
downloadriscv-openocd-9b29cb58acbd14ed831d68fce4d6e6a1728f8caf.zip
riscv-openocd-9b29cb58acbd14ed831d68fce4d6e6a1728f8caf.tar.gz
riscv-openocd-9b29cb58acbd14ed831d68fce4d6e6a1728f8caf.tar.bz2
coding style: remove useless break after a goto or return
In a switch/case statement, a break placed after a goto or return is never executed. The script checkpatch available in Linux kernel v5.1 issues a warning for such unused break statements. In the process of reviewing the new checkpatch for its inclusion in OpenOCD, let's get rid of these warnings. The script checkpatch is unable to fixup automatically this case. Thanks to having "break" command using a single code line, this patch has been generated using the script below: find src/ -type f -exec ./tools/scripts/checkpatch.pl -q \ --types UNNECESSARY_BREAK -f {} \; \ | sed -n '/^#/{s/^.*FILE: //;s/:$//;s/:/ /;p}' \ | awk 'function P() {print "sed -i '\''"b"'\'' "a}; { if ($1!=a) { if (a) {P()}; a=$1; b=$2"{d}"; } else { b=b";"$2"{d}" } }; END {P()}' Change-Id: I56ca098faa5fe8d1e3f712dc0a029a3f10559d99 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5617 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
Diffstat (limited to 'src/svf')
-rw-r--r--src/svf/svf.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/svf/svf.c b/src/svf/svf.c
index 5d87c89..54fc7d1 100644
--- a/src/svf/svf.c
+++ b/src/svf/svf.c
@@ -1310,7 +1310,6 @@ XXR_common:
case PIOMAP:
LOG_ERROR("PIO and PIOMAP are not supported");
return ERROR_FAIL;
- break;
case RUNTEST:
/* RUNTEST [run_state] run_count run_clk [min_time SEC [MAXIMUM max_time
* SEC]] [ENDSTATE end_state] */
@@ -1532,7 +1531,6 @@ XXR_common:
default:
LOG_ERROR("invalid svf command: %s", argus[0]);
return ERROR_FAIL;
- break;
}
if (!svf_quiet) {