openocd: remove NULL comparisons with checkpatch [1/2]
Patch generated automatically through the new checkpatch with flags "--types COMPARISON_TO_NULL --fix-inplace". This only fixes the comparisons if (symbol == NULL) if (symbol != NULL) The case of NULL on the left side of the comparison is not tested. Some automatic fix is incorrect and has been massaged by hands: - if (*psig == NULL) + if (*!psig) changed as + if (!*psig) Change-Id: If4a1e2b4e547e223532e8e3d9da89bf9cb382ce6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6351 Tested-by: jenkins
This commit is contained in:
@@ -238,7 +238,7 @@ static int mem_ap_read_memory(struct target *target, target_addr_t address,
|
||||
LOG_DEBUG("Reading memory at physical address " TARGET_ADDR_FMT
|
||||
"; size %" PRIu32 "; count %" PRIu32, address, size, count);
|
||||
|
||||
if (count == 0 || buffer == NULL)
|
||||
if (count == 0 || !buffer)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
return mem_ap_read_buf(mem_ap->ap, buffer, size, count, address);
|
||||
@@ -253,7 +253,7 @@ static int mem_ap_write_memory(struct target *target, target_addr_t address,
|
||||
LOG_DEBUG("Writing memory at physical address " TARGET_ADDR_FMT
|
||||
"; size %" PRIu32 "; count %" PRIu32, address, size, count);
|
||||
|
||||
if (count == 0 || buffer == NULL)
|
||||
if (count == 0 || !buffer)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
return mem_ap_write_buf(mem_ap->ap, buffer, size, count, address);
|
||||
|
||||
Reference in New Issue
Block a user