dsp563xxx: fix missing error propagation found by clang
authorØyvind Harboe <oyvind.harboe@zylin.com>
Sun, 30 Oct 2011 17:36:47 +0000 (18:36 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 31 Oct 2011 11:04:42 +0000 (11:04 +0000)
Change-Id: I7380ce145b4942e21b174f2a810928a877c32bc7
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/140
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/target/dsp563xx.c

index b7f23c7..a0e1206 100644 (file)
@@ -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++)