From: Martin Schmölzer Date: Sun, 26 Jun 2011 23:00:15 +0000 (+0200) Subject: ULINK driver: Update some comments, fix some coding mistakes X-Git-Tag: v0.6.0-rc1~595 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3633e8d7b8b88d58cfc5989a330dfbaa6b66fad4;p=openocd ULINK driver: Update some comments, fix some coding mistakes Signed-off-by: Martin Schmölzer --- diff --git a/src/jtag/drivers/ulink.c b/src/jtag/drivers/ulink.c index 0e04fd66..f8103942 100644 --- a/src/jtag/drivers/ulink.c +++ b/src/jtag/drivers/ulink.c @@ -136,7 +136,7 @@ struct ulink_cmd { /** 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; @@ -919,6 +919,7 @@ int ulink_append_scan_cmd(struct ulink *device, enum scan_type scan_type, default: LOG_ERROR("BUG: ulink_append_scan_cmd() encountered an unknown scan type"); ret = ERROR_FAIL; + break; } if (ret != ERROR_OK) { @@ -1091,7 +1092,7 @@ int ulink_append_set_signals_cmd(struct ulink *device, uint8_t low, cmd->payload_out[0] = low; cmd->payload_out[1] = high; - return ulink_append_queue(device, cmd);; + return ulink_append_queue(device, cmd); } /** @@ -1265,7 +1266,7 @@ int ulink_queue_scan(struct ulink *device, struct jtag_command *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 */ @@ -1322,7 +1323,7 @@ int ulink_queue_scan(struct ulink *device, struct jtag_command *cmd) 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) { @@ -1618,6 +1619,7 @@ int ulink_post_process_queue(struct ulink *device) ret = ERROR_FAIL; LOG_ERROR("BUG: ulink_post_process_queue() encountered unknown JTAG " "command type"); + break; } if (ret != ERROR_OK) { @@ -1673,6 +1675,7 @@ static int ulink_execute_queue(void) default: ret = ERROR_FAIL; LOG_ERROR("BUG: encountered unknown JTAG command type"); + break; } cmd = cmd->next;