openocd: remove last NULL comparisons
[fw/openocd] / src / server / gdb_server.c
index 015baa1d888a57c903767722668b11c73e74042a..a16b4ccbe901a4c5a0644baa566d41d906360fd1 100644 (file)
@@ -3006,8 +3006,10 @@ static bool gdb_handle_vrun_packet(struct connection *connection, const char *pa
        free(next_hex_encoded_field(&parse, ';'));
 
        char *cmdline = next_hex_encoded_field(&parse, ';');
-       char *arg;
-       while (cmdline && (arg = next_hex_encoded_field(&parse, ';')) != NULL) {
+       while (cmdline) {
+               char *arg = next_hex_encoded_field(&parse, ';');
+               if (!arg)
+                       break;
                char *new_cmdline = alloc_printf("%s %s", cmdline, arg);
                free(cmdline);
                free(arg);
@@ -3549,7 +3551,7 @@ static int gdb_target_start(struct target *target, const char *port)
                struct target_list *head;
                struct target *curr;
                head = target->head;
-               while (head != (struct target_list *)NULL) {
+               while (head) {
                        curr = head->target;
                        if (curr != target)
                                curr->gdb_service = gdb_service;