stlink: Add PID for V3 device without MSD
[fw/openocd] / src / target / target_request.c
index cf588f49fc9f735044a69e752e97a88687148d6b..562b046aadb04ac773ee861f8c5715168e4ba1b1 100644 (file)
@@ -234,7 +234,7 @@ int delete_debug_msg_receiver(struct command_context *cmd_ctx, struct target *ta
                        if (c->cmd_ctx == cmd_ctx) {
                                *p = next;
                                free(c);
-                               if (*p == NULL) {
+                               if (!*p) {
                                        /* disable callback */
                                        target->dbg_msg_enabled = 0;
                                }
@@ -256,13 +256,13 @@ COMMAND_HANDLER(handle_target_request_debugmsgs_command)
 
        int receiving = 0;
 
-       if (target->type->target_request_data == NULL) {
+       if (!target->type->target_request_data) {
                LOG_ERROR("Target %s does not support target requests", target_name(target));
                return ERROR_OK;
        }
 
        /* 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) {