aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2023-05-06 16:19:55 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2023-05-18 10:11:29 +0000
commitcc29abe9d16a19505a43c4d7c29fe7bb69ca6d9f (patch)
tree53bd586b202288d489d9adb150bfa9d2661749ae
parent247d8df3146f2e80487962fe5103cd28f170d288 (diff)
downloadriscv-openocd-cc29abe9d16a19505a43c4d7c29fe7bb69ca6d9f.zip
riscv-openocd-cc29abe9d16a19505a43c4d7c29fe7bb69ca6d9f.tar.gz
riscv-openocd-cc29abe9d16a19505a43c4d7c29fe7bb69ca6d9f.tar.bz2
pld: fix new warnings from sparse
The new committed files add some warning from the static analyser 'sparse': - Don't assign pointer to 0, use NULL. - switch with no cases. Fix them. Change-Id: I2c02d629bd80b71c8e42553be5d9388bb9b6bcd0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7668 Tested-by: jenkins
-rw-r--r--src/pld/lattice_bit.c2
-rw-r--r--src/pld/pld.c2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/pld/lattice_bit.c b/src/pld/lattice_bit.c
index 562b17d..796adce 100644
--- a/src/pld/lattice_bit.c
+++ b/src/pld/lattice_bit.c
@@ -29,7 +29,7 @@ static int lattice_read_bit_file(struct lattice_bit_file *bit_file, const char *
if (retval != ERROR_OK)
return retval;
- bit_file->part = 0;
+ bit_file->part = NULL;
bit_file->has_id = false;
enum read_bit_state state = SEEK_HEADER_START;
for (size_t pos = 1; pos < bit_file->raw_bit.length && state != DONE; ++pos) {
diff --git a/src/pld/pld.c b/src/pld/pld.c
index 7dd2cec..07b575f 100644
--- a/src/pld/pld.c
+++ b/src/pld/pld.c
@@ -156,8 +156,6 @@ COMMAND_HANDLER(handle_pld_load_command)
if (retval != ERROR_OK) {
command_print(CMD, "failed loading file %s to pld device %u",
CMD_ARGV[1], dev_id);
- switch (retval) {
- }
return retval;
} else {
gettimeofday(&end, NULL);