/** Pointer to corresponding OpenOCD command for post-processing */
   struct jtag_command *cmd_origin;
 
-  struct ulink_cmd *next;    ///< Pointer to next command (linked list)
+  struct ulink_cmd *next;     ///< Pointer to next command (linked list)
 };
 
 typedef struct ulink_cmd ulink_cmd_t;
   default:
     LOG_ERROR("BUG: ulink_append_scan_cmd() encountered an unknown scan type");
     ret = ERROR_FAIL;
+    break;
   }
 
   if (ret != ERROR_OK) {
   cmd->payload_out[0] = low;
   cmd->payload_out[1] = high;
 
-  return ulink_append_queue(device, cmd);;
+  return ulink_append_queue(device, cmd);
 }
 
 /**
   /* Determine scan type (IN/OUT/IO) */
   type = jtag_scan_type(cmd->cmd.scan);
 
-  /* Determine number of scan commands */
+  /* Determine number of scan commands with maximum payload */
   scans_max_payload = scan_size_bytes / 58;
 
   /* Determine size of last shift command */
     tms_sequence_resume = tap_get_tms_path(TAP_DRPAUSE, TAP_DRSHIFT);
   }
 
-  /* Generate scan commands with full payload */
+  /* Generate scan commands */
   bytecount = scan_size_bytes;
   while (bytecount > 0) {
     if (bytecount == scan_size_bytes) {
         ret = ERROR_FAIL;
         LOG_ERROR("BUG: ulink_post_process_queue() encountered unknown JTAG "
             "command type");
+        break;
       }
 
       if (ret != ERROR_OK) {
     default:
       ret = ERROR_FAIL;
       LOG_ERROR("BUG: encountered unknown JTAG command type");
+      break;
     }
 
     cmd = cmd->next;