aboutsummaryrefslogtreecommitdiff
path: root/src/target/mips_ejtag.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-07-03 18:51:20 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-07-24 10:37:49 +0100
commit08ee7bb982b16742f52cfdc6c649d82ffa2eb177 (patch)
treea824d376b774499303f00cffb201e35b01830d98 /src/target/mips_ejtag.c
parentb159f5cdedd70fff9309722e927be670845f4df5 (diff)
downloadriscv-openocd-08ee7bb982b16742f52cfdc6c649d82ffa2eb177.zip
riscv-openocd-08ee7bb982b16742f52cfdc6c649d82ffa2eb177.tar.gz
riscv-openocd-08ee7bb982b16742f52cfdc6c649d82ffa2eb177.tar.bz2
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
Diffstat (limited to 'src/target/mips_ejtag.c')
-rw-r--r--src/target/mips_ejtag.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c
index 09af855..b21a1bd 100644
--- a/src/target/mips_ejtag.c
+++ b/src/target/mips_ejtag.c
@@ -32,7 +32,7 @@
void mips_ejtag_set_instr(struct mips_ejtag *ejtag_info, uint32_t new_instr)
{
- assert(ejtag_info->tap != NULL);
+ assert(ejtag_info->tap);
struct jtag_tap *tap = ejtag_info->tap;
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr) {
@@ -68,7 +68,7 @@ static int mips_ejtag_get_impcode(struct mips_ejtag *ejtag_info)
void mips_ejtag_add_scan_96(struct mips_ejtag *ejtag_info, uint32_t ctrl, uint32_t data, uint8_t *in_scan_buf)
{
- assert(ejtag_info->tap != NULL);
+ assert(ejtag_info->tap);
struct jtag_tap *tap = ejtag_info->tap;
struct scan_field field;
@@ -94,7 +94,7 @@ int mips_ejtag_drscan_64(struct mips_ejtag *ejtag_info, uint64_t *data)
struct jtag_tap *tap;
tap = ejtag_info->tap;
- if (tap == NULL)
+ if (!tap)
return ERROR_FAIL;
struct scan_field field;
uint8_t t[8] = { 0 }, r[8];
@@ -122,7 +122,7 @@ int mips_ejtag_drscan_64(struct mips_ejtag *ejtag_info, uint64_t *data)
static void mips_ejtag_drscan_32_queued(struct mips_ejtag *ejtag_info,
uint32_t data_out, uint8_t *data_in)
{
- assert(ejtag_info->tap != NULL);
+ assert(ejtag_info->tap);
struct jtag_tap *tap = ejtag_info->tap;
struct scan_field field;
@@ -160,7 +160,7 @@ void mips_ejtag_drscan_32_out(struct mips_ejtag *ejtag_info, uint32_t data)
int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint8_t *data)
{
- assert(ejtag_info->tap != NULL);
+ assert(ejtag_info->tap);
struct jtag_tap *tap = ejtag_info->tap;
struct scan_field field;
@@ -181,7 +181,7 @@ int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint8_t *data)
void mips_ejtag_drscan_8_out(struct mips_ejtag *ejtag_info, uint8_t data)
{
- assert(ejtag_info->tap != NULL);
+ assert(ejtag_info->tap);
struct jtag_tap *tap = ejtag_info->tap;
struct scan_field field;
@@ -421,7 +421,7 @@ int mips_ejtag_init(struct mips_ejtag *ejtag_info)
int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write_t, uint32_t *data)
{
- assert(ejtag_info->tap != NULL);
+ assert(ejtag_info->tap);
struct jtag_tap *tap = ejtag_info->tap;
struct scan_field fields[2];
@@ -530,7 +530,7 @@ int mips64_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, bool write_t, uint
struct jtag_tap *tap;
tap = ejtag_info->tap;
- assert(tap != NULL);
+ assert(tap);
struct scan_field fields[2];
uint8_t spracc = 0;