From fc553327c0a40b3039388bf9139aad2f9dc8fdf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Sun, 30 Oct 2011 18:36:47 +0100 Subject: [PATCH] dsp563xxx: fix missing error propagation found by clang MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I7380ce145b4942e21b174f2a810928a877c32bc7 Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/140 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/target/dsp563xx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/target/dsp563xx.c b/src/target/dsp563xx.c index b7f23c70..a0e12062 100644 --- a/src/target/dsp563xx.c +++ b/src/target/dsp563xx.c @@ -1323,7 +1323,7 @@ static int dsp563xx_run_algorithm(struct target *target, int timeout_ms, void *arch_info) { int i; - int retvaltemp,retval = 0; + int retval = ERROR_OK; struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target); if (target->state != TARGET_HALTED) @@ -1376,10 +1376,12 @@ static int dsp563xx_run_algorithm(struct target *target, for (i = 0; i < num_mem_params; i++) { if (mem_params[i].direction != PARAM_OUT) - if ((retvaltemp = target_read_buffer(target, mem_params[i].address, mem_params[i].size, mem_params[i].value)) != ERROR_OK) - { - retval = retvaltemp; - } + retval = target_read_buffer(target, + mem_params[i].address, + mem_params[i].size, + mem_params[i].value); + if (retval != ERROR_OK) + return retval; } for (i = 0; i < num_reg_params; i++) -- 2.39.5