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:
@@ -1148,11 +1148,8 @@ static int rlink_scan(struct jtag_command *cmd, enum scan_type type,
|
||||
byte_bits -= chunk_bits;
|
||||
|
||||
if (type != SCAN_OUT) {
|
||||
if (dtc_queue_enqueue_reply(
|
||||
type, buffer, scan_size, tdi_bit_offset,
|
||||
chunk_bits,
|
||||
cmd
|
||||
) == NULL) {
|
||||
if (!dtc_queue_enqueue_reply(type, buffer, scan_size, tdi_bit_offset,
|
||||
chunk_bits, cmd)) {
|
||||
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
@@ -1208,11 +1205,8 @@ static int rlink_scan(struct jtag_command *cmd, enum scan_type type,
|
||||
* and one reply byte */
|
||||
dtc_queue_run_if_full(type == SCAN_IN ? 1 : 2, 1);
|
||||
|
||||
if (dtc_queue_enqueue_reply(
|
||||
type, buffer, scan_size, tdi_bit_offset,
|
||||
extra_bits,
|
||||
cmd
|
||||
) == NULL) {
|
||||
if (!dtc_queue_enqueue_reply(type, buffer, scan_size, tdi_bit_offset,
|
||||
extra_bits, cmd)) {
|
||||
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
@@ -1260,11 +1254,8 @@ static int rlink_scan(struct jtag_command *cmd, enum scan_type type,
|
||||
DTC_CMD_SHIFT_TMS_TDI_BIT_PAIR(1, (*tdi_p & tdi_mask), 0);
|
||||
|
||||
} else {
|
||||
if (dtc_queue_enqueue_reply(
|
||||
type, buffer, scan_size, tdi_bit_offset,
|
||||
1,
|
||||
cmd
|
||||
) == NULL) {
|
||||
if (!dtc_queue_enqueue_reply(type, buffer, scan_size, tdi_bit_offset,
|
||||
1, cmd)) {
|
||||
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -803,7 +803,7 @@ static int vsllink_check_usb_strings(
|
||||
if (retval < 0)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (strstr(desc_string, "Versaloon") == NULL)
|
||||
if (!strstr(desc_string, "Versaloon"))
|
||||
return ERROR_FAIL;
|
||||
|
||||
return ERROR_OK;
|
||||
|
||||
Reference in New Issue
Block a user