tms470: removed unnecessary operations
authorEdgar Grimberg <edgar.grimberg@gmail.com>
Sun, 23 Oct 2011 09:39:50 +0000 (11:39 +0200)
committerØyvind Harboe <oyvindharboe@gmail.com>
Sun, 23 Oct 2011 11:34:05 +0000 (11:34 +0000)
This should silence a warning.

Change-Id: Id91a9ebacae836083b1db2654a8e7bf24b2300e9
Signed-off-by: Edgar Grimberg <edgar.grimberg@gmail.com>
Reviewed-on: http://openocd.zylin.com/52
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
src/flash/nor/tms470.c

index dd9ff5b414f7fabb9785d86a4e811875d8d9a6b4..359d3aa7daf396f4042db0da95582bc65fe23385 100644 (file)
@@ -1244,13 +1244,11 @@ static int get_tms470_info(struct flash_bank *bank, char *buf, int buf_size)
                return ERROR_FLASH_OPERATION_FAILED;
        }
 
-       used += snprintf(buf, buf_size, "\ntms470 information: Chip is %s\n", tms470_info->part_name);
+       used = snprintf(buf, buf_size, "\ntms470 information: Chip is %s\n", tms470_info->part_name);
        buf += used;
        buf_size -= used;
 
-       used += snprintf(buf, buf_size, "Flash protection level 2 is %s\n", tms470_check_flash_unlocked(bank->target) == ERROR_OK ? "disabled" : "enabled");
-       buf += used;
-       buf_size -= used;
+       snprintf(buf, buf_size, "Flash protection level 2 is %s\n", tms470_check_flash_unlocked(bank->target) == ERROR_OK ? "disabled" : "enabled");
 
        return ERROR_OK;
 }