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:
Antonio Borneo
2021-07-03 18:51:20 +02:00
parent b159f5cded
commit 08ee7bb982
166 changed files with 856 additions and 856 deletions
+5 -5
View File
@@ -187,13 +187,13 @@ static int embkernel_update_threads(struct rtos *rtos)
int retval;
const struct embkernel_params *param;
if (rtos == NULL)
if (!rtos)
return -1;
if (rtos->rtos_specific_params == NULL)
if (!rtos->rtos_specific_params)
return -3;
if (rtos->symbols == NULL) {
if (!rtos->symbols) {
LOG_ERROR("No symbols for embKernel");
return -4;
}
@@ -308,13 +308,13 @@ static int embkernel_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
const struct embkernel_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 embkernel_params *) rtos->rtos_specific_params;