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:
@@ -230,7 +230,7 @@ COMMAND_HANDLER(handle_debug_level_command)
|
||||
COMMAND_HANDLER(handle_log_output_command)
|
||||
{
|
||||
if (CMD_ARGC == 0 || (CMD_ARGC == 1 && strcmp(CMD_ARGV[0], "default") == 0)) {
|
||||
if (log_output != stderr && log_output != NULL) {
|
||||
if (log_output != stderr && log_output) {
|
||||
/* Close previous log file, if it was open and wasn't stderr. */
|
||||
fclose(log_output);
|
||||
}
|
||||
@@ -244,7 +244,7 @@ COMMAND_HANDLER(handle_log_output_command)
|
||||
LOG_ERROR("failed to open output log '%s'", CMD_ARGV[0]);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
if (log_output != stderr && log_output != NULL) {
|
||||
if (log_output != stderr && log_output) {
|
||||
/* Close previous log file, if it was open and wasn't stderr. */
|
||||
fclose(log_output);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user