X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Ftms470.c;h=37f0933966062c667a6c338da7d6020e786d4e0f;hb=f24a283ac7765df6f09694a4cee99150cb645ac1;hp=f1eba9cd332db6488dc3e746f6e00a8b6f1d9877;hpb=45d5ec2adeefe369d6a9999fcbcad546bf167241;p=openocd.git diff --git a/src/flash/nor/tms470.c b/src/flash/nor/tms470.c index f1eba9cd33..37f0933966 100644 --- a/src/flash/nor/tms470.c +++ b/src/flash/nor/tms470.c @@ -296,9 +296,9 @@ COMMAND_HANDLER(tms470_handle_flash_keyset_command) int i; for (i = 0; i < 4; i++) { - int start = (0 == strncmp(CMD_ARGV[i], "0x", 2)) ? 2 : 0; + int start = (strncmp(CMD_ARGV[i], "0x", 2) == 0) ? 2 : 0; - if (1 != sscanf(&CMD_ARGV[i][start], "%" SCNx32 "", &flash_keys[i])) { + if (sscanf(&CMD_ARGV[i][start], "%" SCNx32 "", &flash_keys[i]) != 1) { command_print(CMD, "could not process flash key %s", CMD_ARGV[i]); LOG_ERROR("could not process flash key %s", CMD_ARGV[i]); @@ -437,7 +437,7 @@ static int tms470_try_flash_keys(struct target *target, const uint32_t *key_set) target_write_u32(target, 0xFFE89C0C, key_set[i]); } - if (ERROR_OK == tms470_check_flash_unlocked(target)) { + if (tms470_check_flash_unlocked(target) == ERROR_OK) { /* * There seems to be a side-effect of reading the FMPKEY * register in that it re-enables the protection. So we