openocd: manually remove NULL comparisons
For the remaining NULL comparisons, remove then manually. While there, make more readable a loop, by moving the assigment out of the loop condition. Change-Id: I44193aaa95813156a3a79c16b80e1ad333dc1eaf Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6353 Tested-by: jenkins
This commit is contained in:
@@ -484,7 +484,7 @@ struct target *get_target(const char *id)
|
||||
|
||||
/* try as tcltarget name */
|
||||
for (target = all_targets; target; target = target->next) {
|
||||
if (target_name(target) == NULL)
|
||||
if (!target_name(target))
|
||||
continue;
|
||||
if (strcmp(id, target_name(target)) == 0)
|
||||
return target;
|
||||
|
||||
@@ -262,7 +262,7 @@ COMMAND_HANDLER(handle_target_request_debugmsgs_command)
|
||||
}
|
||||
|
||||
/* see if receiver is already registered */
|
||||
if (find_debug_msg_receiver(CMD_CTX, target) != NULL)
|
||||
if (find_debug_msg_receiver(CMD_CTX, target))
|
||||
receiving = 1;
|
||||
|
||||
if (CMD_ARGC > 0) {
|
||||
|
||||
Reference in New Issue
Block a user