openocd: fix simple cases of NULL comparison
There are more than 1000 NULL comparisons to be aligned to the coding style. For recurrent NULL comparison it's preferable using trivial scripts in order to minimize the review effort. Patch generated automatically with the command: sed -i PATTERN $(find src/ -type f) where PATTERN is in the list: 's/(\([a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(\([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(\([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(NULL == \([a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL == \([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL == \([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL != \([a-z][a-z0-9_]*\))/(\1)/g' 's/(NULL != \([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\))/(\1)/g' 's/(NULL != \([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\))/(\1)/g' Change-Id: Ida103e325d6d0600fb69c0b7a1557ee969db4417 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6350 Tested-by: jenkins
This commit is contained in:
@@ -551,7 +551,7 @@ static int esirisc_trace_analyze_buffer(struct command_invocation *cmd)
|
||||
|
||||
size = esirisc_trace_buffer_size(trace_info);
|
||||
buffer = calloc(1, size);
|
||||
if (buffer == NULL) {
|
||||
if (!buffer) {
|
||||
command_print(cmd, "out of memory");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -576,7 +576,7 @@ static int esirisc_trace_analyze_memory(struct command_invocation *cmd,
|
||||
int retval;
|
||||
|
||||
buffer = calloc(1, size);
|
||||
if (buffer == NULL) {
|
||||
if (!buffer) {
|
||||
command_print(cmd, "out of memory");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -628,7 +628,7 @@ static int esirisc_trace_dump_buffer(struct command_invocation *cmd, const char
|
||||
|
||||
size = esirisc_trace_buffer_size(trace_info);
|
||||
buffer = calloc(1, size);
|
||||
if (buffer == NULL) {
|
||||
if (!buffer) {
|
||||
command_print(cmd, "out of memory");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -653,7 +653,7 @@ static int esirisc_trace_dump_memory(struct command_invocation *cmd, const char
|
||||
int retval;
|
||||
|
||||
buffer = calloc(1, size);
|
||||
if (buffer == NULL) {
|
||||
if (!buffer) {
|
||||
command_print(cmd, "out of memory");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user