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:
@@ -160,12 +160,12 @@ static int freertos_update_threads(struct rtos *rtos)
|
||||
unsigned int tasks_found = 0;
|
||||
const struct freertos_params *param;
|
||||
|
||||
if (rtos->rtos_specific_params == NULL)
|
||||
if (!rtos->rtos_specific_params)
|
||||
return -1;
|
||||
|
||||
param = (const struct freertos_params *) rtos->rtos_specific_params;
|
||||
|
||||
if (rtos->symbols == NULL) {
|
||||
if (!rtos->symbols) {
|
||||
LOG_ERROR("No symbols for FreeRTOS");
|
||||
return -3;
|
||||
}
|
||||
@@ -403,13 +403,13 @@ static int freertos_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
|
||||
const struct freertos_params *param;
|
||||
int64_t stack_ptr = 0;
|
||||
|
||||
if (rtos == NULL)
|
||||
if (!rtos)
|
||||
return -1;
|
||||
|
||||
if (thread_id == 0)
|
||||
return -2;
|
||||
|
||||
if (rtos->rtos_specific_params == NULL)
|
||||
if (!rtos->rtos_specific_params)
|
||||
return -1;
|
||||
|
||||
param = (const struct freertos_params *) rtos->rtos_specific_params;
|
||||
@@ -494,13 +494,13 @@ static int freertos_get_thread_ascii_info(struct rtos *rtos, threadid_t thread_i
|
||||
int retval;
|
||||
const struct freertos_params *param;
|
||||
|
||||
if (rtos == NULL)
|
||||
if (!rtos)
|
||||
return -1;
|
||||
|
||||
if (thread_id == 0)
|
||||
return -2;
|
||||
|
||||
if (rtos->rtos_specific_params == NULL)
|
||||
if (!rtos->rtos_specific_params)
|
||||
return -3;
|
||||
|
||||
param = (const struct freertos_params *) rtos->rtos_specific_params;
|
||||
|
||||
Reference in New Issue
Block a user