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

View File

@@ -392,7 +392,7 @@ static inline bool is_64bit_ap(struct adiv5_ap *ap)
static inline int dap_send_sequence(struct adiv5_dap *dap,
enum swd_special_seq seq)
{
assert(dap->ops != NULL);
assert(dap->ops);
return dap->ops->send_sequence(dap, seq);
}
@@ -411,7 +411,7 @@ static inline int dap_send_sequence(struct adiv5_dap *dap,
static inline int dap_queue_dp_read(struct adiv5_dap *dap,
unsigned reg, uint32_t *data)
{
assert(dap->ops != NULL);
assert(dap->ops);
return dap->ops->queue_dp_read(dap, reg, data);
}
@@ -429,7 +429,7 @@ static inline int dap_queue_dp_read(struct adiv5_dap *dap,
static inline int dap_queue_dp_write(struct adiv5_dap *dap,
unsigned reg, uint32_t data)
{
assert(dap->ops != NULL);
assert(dap->ops);
return dap->ops->queue_dp_write(dap, reg, data);
}
@@ -479,7 +479,7 @@ static inline int dap_queue_ap_write(struct adiv5_ap *ap,
*/
static inline int dap_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack)
{
assert(dap->ops != NULL);
assert(dap->ops);
return dap->ops->queue_ap_abort(dap, ack);
}
@@ -495,13 +495,13 @@ static inline int dap_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack)
*/
static inline int dap_run(struct adiv5_dap *dap)
{
assert(dap->ops != NULL);
assert(dap->ops);
return dap->ops->run(dap);
}
static inline int dap_sync(struct adiv5_dap *dap)
{
assert(dap->ops != NULL);
assert(dap->ops);
if (dap->ops->sync)
return dap->ops->sync(dap);
return ERROR_OK;