openocd: remove NULL comparisons with checkpatch [1/2]

Patch generated automatically through the new checkpatch with
flags "--types COMPARISON_TO_NULL --fix-inplace".
This only fixes the comparisons
	if (symbol == NULL)
	if (symbol != NULL)
The case of NULL on the left side of the comparison is not tested.

Some automatic fix is incorrect and has been massaged by hands:
	-	if (*psig == NULL)
	+	if (*!psig)
changed as
	+	if (!*psig)

Change-Id: If4a1e2b4e547e223532e8e3d9da89bf9cb382ce6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6351
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2021-07-03 21:29:32 +02:00
parent 08ee7bb982
commit 3917823187
71 changed files with 181 additions and 181 deletions

View File

@@ -3545,7 +3545,7 @@ COMMAND_HANDLER(sam3_handle_info_command)
int r;
/* bank0 must exist before we can do anything */
if (chip->details.bank[0].bank == NULL) {
if (!chip->details.bank[0].bank) {
x = 0;
need_define:
command_print(CMD,
@@ -3571,7 +3571,7 @@ need_define:
if (!(chip->details.bank[x].present))
continue;
if (chip->details.bank[x].bank == NULL)
if (!chip->details.bank[x].bank)
goto need_define;
if (chip->details.bank[x].probed)
@@ -3606,7 +3606,7 @@ COMMAND_HANDLER(sam3_handle_gpnvm_command)
return ERROR_TARGET_NOT_HALTED;
}
if (chip->details.bank[0].bank == NULL) {
if (!chip->details.bank[0].bank) {
command_print(CMD, "Bank0 must be defined first via: flash bank %s ...",
at91sam3_flash.name);
return ERROR_FAIL;