openocd: fix Yoda conditions with checkpatch
The new checkpatch can automatically fix the code, but this feature is still error prone and not complete. Patch generated automatically through the new checkpatch with flags "--types CONSTANT_COMPARISON --fix-inplace". Some Yoda condition is detected by checkpatch but not fixed; it will be fixed manually in a following commit. Change-Id: Ifaaa1159e63dbd1db6aa3c017125df9874fa9703 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6355 Tested-by: jenkins
This commit is contained in:
@@ -121,7 +121,7 @@ int aice_init_targets(void)
|
||||
*/
|
||||
static int aice_init(void)
|
||||
{
|
||||
if (ERROR_OK != aice_port->api->open(¶m)) {
|
||||
if (aice_port->api->open(¶m) != ERROR_OK) {
|
||||
LOG_ERROR("Cannot find AICE Interface! Please check "
|
||||
"connection and permissions.");
|
||||
return ERROR_JTAG_INIT_FAILED;
|
||||
@@ -217,7 +217,7 @@ static int aice_khz(int khz, int *jtag_speed)
|
||||
int i;
|
||||
for (i = 0 ; i < AICE_KHZ_TO_SPEED_MAP_SIZE ; i++) {
|
||||
if (khz == aice_khz_to_speed_map[i]) {
|
||||
if (8 <= i)
|
||||
if (i >= 8)
|
||||
*jtag_speed = i | AICE_TCK_CONTROL_TCK3048;
|
||||
else
|
||||
*jtag_speed = i;
|
||||
|
||||
@@ -1835,9 +1835,9 @@ static int aice_check_dbger(uint32_t coreid, uint32_t expect_status)
|
||||
aice_read_misc(coreid, NDS_EDM_MISC_DBGER, &value_dbger);
|
||||
|
||||
if ((value_dbger & expect_status) == expect_status) {
|
||||
if (ERROR_OK != check_suppressed_exception(coreid, value_dbger))
|
||||
if (check_suppressed_exception(coreid, value_dbger) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
if (ERROR_OK != check_privilege(coreid, value_dbger))
|
||||
if (check_privilege(coreid, value_dbger) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -1895,18 +1895,18 @@ static int aice_read_reg(uint32_t coreid, uint32_t num, uint32_t *val)
|
||||
|
||||
uint32_t instructions[4]; /** execute instructions in DIM */
|
||||
|
||||
if (NDS32_REG_TYPE_GPR == nds32_reg_type(num)) { /* general registers */
|
||||
if (nds32_reg_type(num) == NDS32_REG_TYPE_GPR) { /* general registers */
|
||||
instructions[0] = MTSR_DTR(num);
|
||||
instructions[1] = DSB;
|
||||
instructions[2] = NOP;
|
||||
instructions[3] = BEQ_MINUS_12;
|
||||
} else if (NDS32_REG_TYPE_SPR == nds32_reg_type(num)) { /* user special registers */
|
||||
} else if (nds32_reg_type(num) == NDS32_REG_TYPE_SPR) { /* user special registers */
|
||||
instructions[0] = MFUSR_G0(0, nds32_reg_sr_index(num));
|
||||
instructions[1] = MTSR_DTR(0);
|
||||
instructions[2] = DSB;
|
||||
instructions[3] = BEQ_MINUS_12;
|
||||
} else if (NDS32_REG_TYPE_AUMR == nds32_reg_type(num)) { /* audio registers */
|
||||
if ((CB_CTL <= num) && (num <= CBE3)) {
|
||||
} else if (nds32_reg_type(num) == NDS32_REG_TYPE_AUMR) { /* audio registers */
|
||||
if ((num >= CB_CTL) && (num <= CBE3)) {
|
||||
instructions[0] = AMFAR2(0, nds32_reg_sr_index(num));
|
||||
instructions[1] = MTSR_DTR(0);
|
||||
instructions[2] = DSB;
|
||||
@@ -1917,7 +1917,7 @@ static int aice_read_reg(uint32_t coreid, uint32_t num, uint32_t *val)
|
||||
instructions[2] = DSB;
|
||||
instructions[3] = BEQ_MINUS_12;
|
||||
}
|
||||
} else if (NDS32_REG_TYPE_FPU == nds32_reg_type(num)) { /* fpu registers */
|
||||
} else if (nds32_reg_type(num) == NDS32_REG_TYPE_FPU) { /* fpu registers */
|
||||
if (num == FPCSR) {
|
||||
instructions[0] = FMFCSR;
|
||||
instructions[1] = MTSR_DTR(0);
|
||||
@@ -1983,7 +1983,7 @@ static int aice_usb_read_reg(uint32_t coreid, uint32_t num, uint32_t *val)
|
||||
} else if ((core_info[coreid].target_dtr_valid == true) && (num == DR43)) {
|
||||
*val = core_info[coreid].target_dtr_backup;
|
||||
} else {
|
||||
if (ERROR_OK != aice_read_reg(coreid, num, val))
|
||||
if (aice_read_reg(coreid, num, val) != ERROR_OK)
|
||||
*val = 0xBBADBEEF;
|
||||
}
|
||||
|
||||
@@ -2004,18 +2004,18 @@ static int aice_write_reg(uint32_t coreid, uint32_t num, uint32_t val)
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
if (NDS32_REG_TYPE_GPR == nds32_reg_type(num)) { /* general registers */
|
||||
if (nds32_reg_type(num) == NDS32_REG_TYPE_GPR) { /* general registers */
|
||||
instructions[0] = MFSR_DTR(num);
|
||||
instructions[1] = DSB;
|
||||
instructions[2] = NOP;
|
||||
instructions[3] = BEQ_MINUS_12;
|
||||
} else if (NDS32_REG_TYPE_SPR == nds32_reg_type(num)) { /* user special registers */
|
||||
} else if (nds32_reg_type(num) == NDS32_REG_TYPE_SPR) { /* user special registers */
|
||||
instructions[0] = MFSR_DTR(0);
|
||||
instructions[1] = MTUSR_G0(0, nds32_reg_sr_index(num));
|
||||
instructions[2] = DSB;
|
||||
instructions[3] = BEQ_MINUS_12;
|
||||
} else if (NDS32_REG_TYPE_AUMR == nds32_reg_type(num)) { /* audio registers */
|
||||
if ((CB_CTL <= num) && (num <= CBE3)) {
|
||||
} else if (nds32_reg_type(num) == NDS32_REG_TYPE_AUMR) { /* audio registers */
|
||||
if ((num >= CB_CTL) && (num <= CBE3)) {
|
||||
instructions[0] = MFSR_DTR(0);
|
||||
instructions[1] = AMTAR2(0, nds32_reg_sr_index(num));
|
||||
instructions[2] = DSB;
|
||||
@@ -2026,7 +2026,7 @@ static int aice_write_reg(uint32_t coreid, uint32_t num, uint32_t val)
|
||||
instructions[2] = DSB;
|
||||
instructions[3] = BEQ_MINUS_12;
|
||||
}
|
||||
} else if (NDS32_REG_TYPE_FPU == nds32_reg_type(num)) { /* fpu registers */
|
||||
} else if (nds32_reg_type(num) == NDS32_REG_TYPE_FPU) { /* fpu registers */
|
||||
if (num == FPCSR) {
|
||||
instructions[0] = MFSR_DTR(0);
|
||||
instructions[1] = FMTCSR;
|
||||
@@ -2146,7 +2146,7 @@ static int aice_usb_read_reg_64(uint32_t coreid, uint32_t num, uint64_t *val)
|
||||
uint32_t value;
|
||||
uint32_t high_value;
|
||||
|
||||
if (ERROR_OK != aice_read_reg(coreid, num, &value))
|
||||
if (aice_read_reg(coreid, num, &value) != ERROR_OK)
|
||||
value = 0xBBADBEEF;
|
||||
|
||||
aice_read_reg(coreid, R1, &high_value);
|
||||
@@ -2503,10 +2503,10 @@ static int aice_restore_tmp_registers(uint32_t coreid)
|
||||
|
||||
static int aice_open_device(struct aice_port_param_s *param)
|
||||
{
|
||||
if (ERROR_OK != aice_usb_open(param))
|
||||
if (aice_usb_open(param) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_FAIL == aice_get_version_info()) {
|
||||
if (aice_get_version_info() == ERROR_FAIL) {
|
||||
LOG_ERROR("Cannot get AICE version!");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -2514,7 +2514,7 @@ static int aice_open_device(struct aice_port_param_s *param)
|
||||
LOG_INFO("AICE initialization started");
|
||||
|
||||
/* attempt to reset Andes EDM */
|
||||
if (ERROR_FAIL == aice_reset_box()) {
|
||||
if (aice_reset_box() == ERROR_FAIL) {
|
||||
LOG_ERROR("Cannot initial AICE box!");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -2526,7 +2526,7 @@ static int aice_usb_set_jtag_clock(uint32_t a_clock)
|
||||
{
|
||||
jtag_clock = a_clock;
|
||||
|
||||
if (ERROR_OK != aice_usb_set_clock(a_clock)) {
|
||||
if (aice_usb_set_clock(a_clock) != ERROR_OK) {
|
||||
LOG_ERROR("Cannot set AICE JTAG clock!");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -2705,7 +2705,7 @@ static int aice_usb_state(uint32_t coreid, enum aice_target_state_s *state)
|
||||
/* Clear CRST */
|
||||
aice_write_misc(coreid, NDS_EDM_MISC_DBGER, NDS_DBGER_CRST);
|
||||
} else if ((dbger_value & NDS_DBGER_DEX) == NDS_DBGER_DEX) {
|
||||
if (AICE_TARGET_RUNNING == core_info[coreid].core_state) {
|
||||
if (core_info[coreid].core_state == AICE_TARGET_RUNNING) {
|
||||
/* enter debug mode, init EDM registers */
|
||||
/* backup EDM registers */
|
||||
aice_backup_edm_registers(coreid);
|
||||
@@ -2713,7 +2713,7 @@ static int aice_usb_state(uint32_t coreid, enum aice_target_state_s *state)
|
||||
aice_init_edm_registers(coreid, true);
|
||||
aice_backup_tmp_registers(coreid);
|
||||
core_info[coreid].core_state = AICE_TARGET_HALTED;
|
||||
} else if (AICE_TARGET_UNKNOWN == core_info[coreid].core_state) {
|
||||
} else if (core_info[coreid].core_state == AICE_TARGET_UNKNOWN) {
|
||||
/* debug 'debug mode', use force debug to halt core */
|
||||
aice_usb_halt(coreid);
|
||||
}
|
||||
@@ -2889,7 +2889,7 @@ static int aice_usb_assert_srst(uint32_t coreid, enum aice_srst_type_s srst)
|
||||
if (srst == AICE_SRST)
|
||||
result = aice_issue_srst(coreid);
|
||||
else {
|
||||
if (1 == total_num_of_core)
|
||||
if (total_num_of_core == 1)
|
||||
result = aice_issue_reset_hold(coreid);
|
||||
else
|
||||
result = aice_issue_reset_hold_multi();
|
||||
@@ -2972,7 +2972,7 @@ static int aice_usb_step(uint32_t coreid)
|
||||
aice_write_reg(coreid, ir0_reg_num, ir0_value);
|
||||
}
|
||||
|
||||
if (ERROR_FAIL == aice_usb_run(coreid))
|
||||
if (aice_usb_run(coreid) == ERROR_FAIL)
|
||||
return ERROR_FAIL;
|
||||
|
||||
int i = 0;
|
||||
@@ -3092,7 +3092,7 @@ static int aice_usb_read_memory_unit(uint32_t coreid, uint32_t addr, uint32_t si
|
||||
", size: %" PRIu32 ", count: %" PRIu32 "",
|
||||
addr, size, count);
|
||||
|
||||
if (NDS_MEMORY_ACC_CPU == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_CPU)
|
||||
aice_usb_set_address_dim(coreid, addr);
|
||||
|
||||
uint32_t value;
|
||||
@@ -3101,7 +3101,7 @@ static int aice_usb_read_memory_unit(uint32_t coreid, uint32_t addr, uint32_t si
|
||||
|
||||
switch (size) {
|
||||
case 1:
|
||||
if (NDS_MEMORY_ACC_BUS == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_BUS)
|
||||
read_mem_func = aice_usb_read_mem_b_bus;
|
||||
else
|
||||
read_mem_func = aice_usb_read_mem_b_dim;
|
||||
@@ -3113,7 +3113,7 @@ static int aice_usb_read_memory_unit(uint32_t coreid, uint32_t addr, uint32_t si
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (NDS_MEMORY_ACC_BUS == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_BUS)
|
||||
read_mem_func = aice_usb_read_mem_h_bus;
|
||||
else
|
||||
read_mem_func = aice_usb_read_mem_h_dim;
|
||||
@@ -3127,7 +3127,7 @@ static int aice_usb_read_memory_unit(uint32_t coreid, uint32_t addr, uint32_t si
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (NDS_MEMORY_ACC_BUS == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_BUS)
|
||||
read_mem_func = aice_usb_read_mem_w_bus;
|
||||
else
|
||||
read_mem_func = aice_usb_read_mem_w_dim;
|
||||
@@ -3211,7 +3211,7 @@ static int aice_usb_write_memory_unit(uint32_t coreid, uint32_t addr, uint32_t s
|
||||
", size: %" PRIu32 ", count: %" PRIu32 "",
|
||||
addr, size, count);
|
||||
|
||||
if (NDS_MEMORY_ACC_CPU == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_CPU)
|
||||
aice_usb_set_address_dim(coreid, addr);
|
||||
|
||||
size_t i;
|
||||
@@ -3219,7 +3219,7 @@ static int aice_usb_write_memory_unit(uint32_t coreid, uint32_t addr, uint32_t s
|
||||
|
||||
switch (size) {
|
||||
case 1:
|
||||
if (NDS_MEMORY_ACC_BUS == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_BUS)
|
||||
write_mem_func = aice_usb_write_mem_b_bus;
|
||||
else
|
||||
write_mem_func = aice_usb_write_mem_b_dim;
|
||||
@@ -3231,7 +3231,7 @@ static int aice_usb_write_memory_unit(uint32_t coreid, uint32_t addr, uint32_t s
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (NDS_MEMORY_ACC_BUS == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_BUS)
|
||||
write_mem_func = aice_usb_write_mem_h_bus;
|
||||
else
|
||||
write_mem_func = aice_usb_write_mem_h_dim;
|
||||
@@ -3246,7 +3246,7 @@ static int aice_usb_write_memory_unit(uint32_t coreid, uint32_t addr, uint32_t s
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (NDS_MEMORY_ACC_BUS == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_BUS)
|
||||
write_mem_func = aice_usb_write_mem_w_bus;
|
||||
else
|
||||
write_mem_func = aice_usb_write_mem_w_dim;
|
||||
@@ -3322,10 +3322,10 @@ static int aice_usb_bulk_read_mem(uint32_t coreid, uint32_t addr,
|
||||
|
||||
int retval;
|
||||
|
||||
if (NDS_MEMORY_ACC_CPU == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_CPU)
|
||||
aice_usb_set_address_dim(coreid, addr);
|
||||
|
||||
if (NDS_MEMORY_ACC_CPU == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_CPU)
|
||||
retval = aice_usb_read_memory_unit(coreid, addr, 4, length / 4, buffer);
|
||||
else
|
||||
retval = aice_bulk_read_mem(coreid, addr, length / 4, buffer);
|
||||
@@ -3340,10 +3340,10 @@ static int aice_usb_bulk_write_mem(uint32_t coreid, uint32_t addr,
|
||||
|
||||
int retval;
|
||||
|
||||
if (NDS_MEMORY_ACC_CPU == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_CPU)
|
||||
aice_usb_set_address_dim(coreid, addr);
|
||||
|
||||
if (NDS_MEMORY_ACC_CPU == core_info[coreid].access_channel)
|
||||
if (core_info[coreid].access_channel == NDS_MEMORY_ACC_CPU)
|
||||
retval = aice_usb_write_memory_unit(coreid, addr, 4, length / 4, buffer);
|
||||
else
|
||||
retval = aice_bulk_write_mem(coreid, addr, length / 4, buffer);
|
||||
@@ -3353,7 +3353,7 @@ static int aice_usb_bulk_write_mem(uint32_t coreid, uint32_t addr,
|
||||
|
||||
static int aice_usb_read_debug_reg(uint32_t coreid, uint32_t addr, uint32_t *val)
|
||||
{
|
||||
if (AICE_TARGET_HALTED == core_info[coreid].core_state) {
|
||||
if (core_info[coreid].core_state == AICE_TARGET_HALTED) {
|
||||
if (addr == NDS_EDM_SR_EDMSW) {
|
||||
*val = core_info[coreid].edmsw_backup;
|
||||
} else if (addr == NDS_EDM_SR_EDM_DTR) {
|
||||
@@ -3373,7 +3373,7 @@ static int aice_usb_read_debug_reg(uint32_t coreid, uint32_t addr, uint32_t *val
|
||||
|
||||
static int aice_usb_write_debug_reg(uint32_t coreid, uint32_t addr, const uint32_t val)
|
||||
{
|
||||
if (AICE_TARGET_HALTED == core_info[coreid].core_state) {
|
||||
if (core_info[coreid].core_state == AICE_TARGET_HALTED) {
|
||||
if (addr == NDS_EDM_SR_EDM_DTR) {
|
||||
core_info[coreid].host_dtr_backup = val;
|
||||
core_info[coreid].edmsw_backup |= 0x2;
|
||||
@@ -3402,7 +3402,7 @@ static int aice_usb_memory_mode(uint32_t coreid, enum nds_memory_select mem_sele
|
||||
|
||||
core_info[coreid].memory_select = mem_select;
|
||||
|
||||
if (NDS_MEMORY_SELECT_AUTO != core_info[coreid].memory_select)
|
||||
if (core_info[coreid].memory_select != NDS_MEMORY_SELECT_AUTO)
|
||||
aice_write_misc(coreid, NDS_EDM_MISC_ACC_CTL,
|
||||
core_info[coreid].memory_select - 1);
|
||||
else
|
||||
@@ -3454,13 +3454,13 @@ static int aice_usb_read_tlb(uint32_t coreid, target_addr_t virtual_address,
|
||||
aice_read_reg(coreid, MR4, &value_mr4);
|
||||
|
||||
access_page_size = value_mr4 & 0xF;
|
||||
if (0 == access_page_size) { /* 4K page */
|
||||
if (access_page_size == 0) { /* 4K page */
|
||||
virtual_offset = virtual_address & 0x00000FFF;
|
||||
physical_page_number = value_mr3 & 0xFFFFF000;
|
||||
} else if (1 == access_page_size) { /* 8K page */
|
||||
} else if (access_page_size == 1) { /* 8K page */
|
||||
virtual_offset = virtual_address & 0x00001FFF;
|
||||
physical_page_number = value_mr3 & 0xFFFFE000;
|
||||
} else if (5 == access_page_size) { /* 1M page */
|
||||
} else if (access_page_size == 5) { /* 1M page */
|
||||
virtual_offset = virtual_address & 0x000FFFFF;
|
||||
physical_page_number = value_mr3 & 0xFFF00000;
|
||||
} else {
|
||||
@@ -3546,10 +3546,10 @@ static int aice_usb_dcache_inval_all(uint32_t coreid)
|
||||
cache_index = (way_index << (dcache->log2_set + dcache->log2_line_size)) |
|
||||
(set_index << dcache->log2_line_size);
|
||||
|
||||
if (ERROR_OK != aice_write_dtr(coreid, cache_index))
|
||||
if (aice_write_dtr(coreid, cache_index) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != aice_execute_dim(coreid, instructions, 4))
|
||||
if (aice_execute_dim(coreid, instructions, 4) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -3594,10 +3594,10 @@ static int aice_usb_dcache_wb_all(uint32_t coreid)
|
||||
cache_index = (way_index << (dcache->log2_set + dcache->log2_line_size)) |
|
||||
(set_index << dcache->log2_line_size);
|
||||
|
||||
if (ERROR_OK != aice_write_dtr(coreid, cache_index))
|
||||
if (aice_write_dtr(coreid, cache_index) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != aice_execute_dim(coreid, instructions, 4))
|
||||
if (aice_execute_dim(coreid, instructions, 4) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -3642,10 +3642,10 @@ static int aice_usb_icache_inval_all(uint32_t coreid)
|
||||
cache_index = (way_index << (icache->log2_set + icache->log2_line_size)) |
|
||||
(set_index << icache->log2_line_size);
|
||||
|
||||
if (ERROR_OK != aice_write_dtr(coreid, cache_index))
|
||||
if (aice_write_dtr(coreid, cache_index) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != aice_execute_dim(coreid, instructions, 4))
|
||||
if (aice_execute_dim(coreid, instructions, 4) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -3896,13 +3896,13 @@ static int fill_profiling_batch_commands(uint32_t coreid, uint32_t reg_no)
|
||||
aice_read_dtr_to_buffer(coreid, AICE_BATCH_DATA_BUFFER_0);
|
||||
|
||||
/* get samples */
|
||||
if (NDS32_REG_TYPE_GPR == nds32_reg_type(reg_no)) {
|
||||
if (nds32_reg_type(reg_no) == NDS32_REG_TYPE_GPR) {
|
||||
/* general registers */
|
||||
dim_instructions[0] = MTSR_DTR(reg_no);
|
||||
dim_instructions[1] = DSB;
|
||||
dim_instructions[2] = NOP;
|
||||
dim_instructions[3] = BEQ_MINUS_12;
|
||||
} else if (NDS32_REG_TYPE_SPR == nds32_reg_type(reg_no)) {
|
||||
} else if (nds32_reg_type(reg_no) == NDS32_REG_TYPE_SPR) {
|
||||
/* user special registers */
|
||||
dim_instructions[0] = MFUSR_G0(0, nds32_reg_sr_index(reg_no));
|
||||
dim_instructions[1] = MTSR_DTR(0);
|
||||
|
||||
@@ -243,7 +243,7 @@ struct jtag_tap *jtag_tap_by_string(const char *s)
|
||||
struct jtag_tap *t = jtag_all_taps();
|
||||
|
||||
while (t) {
|
||||
if (0 == strcmp(t->dotted_name, s))
|
||||
if (strcmp(t->dotted_name, s) == 0)
|
||||
return t;
|
||||
t = t->next_tap;
|
||||
}
|
||||
@@ -1197,7 +1197,7 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap *tap)
|
||||
return true;
|
||||
|
||||
/* treat "-expected-id 0" as a "don't-warn" wildcard */
|
||||
if (0 == tap->expected_ids[ii])
|
||||
if (tap->expected_ids[ii] == 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -800,7 +800,7 @@ static void buspirate_tap_append(int tms, int tdi)
|
||||
int bit_index = tap_chain_index % 8;
|
||||
uint8_t bit = 1 << bit_index;
|
||||
|
||||
if (0 == bit_index) {
|
||||
if (bit_index == 0) {
|
||||
/* Let's say that the TAP shift operation wants to shift 9 bits,
|
||||
so we will be sending to the Bus Pirate a bit count of 9 but still
|
||||
full 16 bits (2 bytes) of shift data.
|
||||
@@ -1178,13 +1178,13 @@ static int buspirate_serial_setspeed(int fd, char speed, cc_t timeout)
|
||||
|
||||
/* set the serial port parameters */
|
||||
fcntl(fd, F_SETFL, 0);
|
||||
if (0 != tcgetattr(fd, &t_opt))
|
||||
if (tcgetattr(fd, &t_opt) != 0)
|
||||
return -1;
|
||||
|
||||
if (0 != cfsetispeed(&t_opt, baud))
|
||||
if (cfsetispeed(&t_opt, baud) != 0)
|
||||
return -1;
|
||||
|
||||
if (0 != cfsetospeed(&t_opt, baud))
|
||||
if (cfsetospeed(&t_opt, baud) != 0)
|
||||
return -1;
|
||||
|
||||
t_opt.c_cflag |= (CLOCAL | CREAD);
|
||||
@@ -1206,7 +1206,7 @@ static int buspirate_serial_setspeed(int fd, char speed, cc_t timeout)
|
||||
/* Note that, in the past, TCSANOW was used below instead of TCSADRAIN,
|
||||
and CMD_UART_SPEED did not work properly then, at least with
|
||||
the Bus Pirate v3.5 (USB). */
|
||||
if (0 != tcsetattr(fd, TCSADRAIN, &t_opt)) {
|
||||
if (tcsetattr(fd, TCSADRAIN, &t_opt) != 0) {
|
||||
/* According to the Linux documentation, this is actually not enough
|
||||
to detect errors, you need to call tcgetattr() and check that
|
||||
all changes have been performed successfully. */
|
||||
|
||||
@@ -73,7 +73,7 @@ static int cmsis_dap_hid_open(struct cmsis_dap *dap, uint16_t vids[], uint16_t p
|
||||
while (cur_dev) {
|
||||
bool found = false;
|
||||
|
||||
if (0 == vids[0]) {
|
||||
if (vids[0] == 0) {
|
||||
if (!cur_dev->product_string) {
|
||||
LOG_DEBUG("Cannot read product string of device 0x%x:0x%x",
|
||||
cur_dev->vendor_id, cur_dev->product_id);
|
||||
|
||||
@@ -126,12 +126,12 @@ RESULT usbtoxxx_execute_command(void)
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
versaloon_free_want_pos();
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
if (3 == usbtoxxx_buffer_index) {
|
||||
if (usbtoxxx_buffer_index == 3) {
|
||||
versaloon_free_want_pos();
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ RESULT usbtoxxx_execute_command(void)
|
||||
versaloon_buf[0] = USB_TO_ALL;
|
||||
SET_LE_U16(&versaloon_buf[1], usbtoxxx_buffer_index);
|
||||
|
||||
if (ERROR_OK != versaloon_send_command(usbtoxxx_buffer_index, &inlen)) {
|
||||
if (versaloon_send_command(usbtoxxx_buffer_index, &inlen) != ERROR_OK) {
|
||||
versaloon_free_want_pos();
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ RESULT usbtoxxx_execute_command(void)
|
||||
usbtoxxx_buffer_index = 0;
|
||||
for (i = 0; i < versaloon_pending_idx; i++) {
|
||||
/* check result */
|
||||
if ((0 == i) || !((versaloon_pending[i].collect)
|
||||
if ((i == 0) || !((versaloon_pending[i].collect)
|
||||
&& (versaloon_pending[i - 1].collect)
|
||||
&& (versaloon_pending[i].cmd
|
||||
== versaloon_pending[i - 1].cmd))) {
|
||||
@@ -159,7 +159,7 @@ RESULT usbtoxxx_execute_command(void)
|
||||
"current dongle");
|
||||
result = ERROR_FAIL;
|
||||
break;
|
||||
} else if (USB_TO_XXX_OK != versaloon_buf[usbtoxxx_buffer_index]) {
|
||||
} else if (versaloon_buf[usbtoxxx_buffer_index] != USB_TO_XXX_OK) {
|
||||
LOG_ERROR("%s command 0x%02x failed with 0x%02x",
|
||||
usbtoxxx_get_type_name(versaloon_pending[i].type),
|
||||
versaloon_pending[i].cmd,
|
||||
@@ -245,8 +245,8 @@ RESULT usbtoxxx_init(void)
|
||||
{
|
||||
versaloon_pending_idx = 0;
|
||||
|
||||
if ((ERROR_OK != usbtoinfo_get_abilities(usbtoxxx_abilities)) ||
|
||||
(ERROR_OK != usbtoxxx_execute_command()))
|
||||
if ((usbtoinfo_get_abilities(usbtoxxx_abilities) != ERROR_OK) ||
|
||||
(usbtoxxx_execute_command() != ERROR_OK))
|
||||
return ERROR_FAIL;
|
||||
LOG_INFO("USB_TO_XXX abilities: 0x%08X:0x%08X:0x%08X",
|
||||
GET_LE_U32(&usbtoxxx_abilities[0]),
|
||||
@@ -283,7 +283,7 @@ static RESULT usbtoxxx_ensure_buffer_size(uint16_t cmdlen)
|
||||
|
||||
memset(&context_tmp, 0, sizeof(context_tmp));
|
||||
if (poll_nesting) {
|
||||
if (0 == poll_context.type_pre) {
|
||||
if (poll_context.type_pre == 0) {
|
||||
LOG_BUG("USB_TO_POLL toooooo long");
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -329,18 +329,18 @@ RESULT usbtoxxx_add_command(uint8_t type, uint8_t cmd, uint8_t *cmdbuf,
|
||||
|
||||
/* 3 more bytes by usbtoxxx_validate_current_command_type */
|
||||
/* 3 more bytes when ((0 == collect_index) || (collect_cmd != cmd)) */
|
||||
if (ERROR_OK != usbtoxxx_ensure_buffer_size(cmdlen + 6))
|
||||
if (usbtoxxx_ensure_buffer_size(cmdlen + 6) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if ((type_pre != type) || (!usbtoxxx_buffer)) {
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
type_pre = type;
|
||||
}
|
||||
|
||||
if ((0 == collect_index) || (collect_cmd != cmd)) {
|
||||
if ((collect_index == 0) || (collect_cmd != cmd)) {
|
||||
usbtoxxx_buffer[usbtoxxx_current_cmd_index++] = cmd;
|
||||
|
||||
if (collect) {
|
||||
@@ -368,10 +368,10 @@ RESULT usbtoxxx_add_command(uint8_t type, uint8_t cmd, uint8_t *cmdbuf,
|
||||
|
||||
RESULT usbtoinfo_get_abilities(uint8_t abilities[USB_TO_XXX_ABILITIES_LEN])
|
||||
{
|
||||
if (ERROR_OK != usbtoxxx_ensure_buffer_size(3))
|
||||
if (usbtoxxx_ensure_buffer_size(3) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
@@ -383,12 +383,12 @@ RESULT usbtoinfo_get_abilities(uint8_t abilities[USB_TO_XXX_ABILITIES_LEN])
|
||||
|
||||
RESULT usbtopoll_start(uint16_t retry_cnt, uint16_t interval_us)
|
||||
{
|
||||
if (ERROR_OK != usbtoxxx_ensure_buffer_size(3 + 5))
|
||||
if (usbtoxxx_ensure_buffer_size(3 + 5) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
if (!poll_nesting)
|
||||
usbtoxxx_save_context(&poll_context);
|
||||
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
@@ -410,10 +410,10 @@ RESULT usbtopoll_end(void)
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "check poll nesting");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
if (ERROR_OK != usbtoxxx_ensure_buffer_size(3 + 1))
|
||||
if (usbtoxxx_ensure_buffer_size(3 + 1) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
@@ -439,10 +439,10 @@ RESULT usbtopoll_checkok(uint8_t equ, uint16_t offset, uint8_t size,
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "check poll nesting");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
if (ERROR_OK != usbtoxxx_ensure_buffer_size(3 + 4 + 2 * size))
|
||||
if (usbtoxxx_ensure_buffer_size(3 + 4 + 2 * size) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
@@ -475,10 +475,10 @@ RESULT usbtopoll_checkfail(uint8_t equ, uint16_t offset, uint8_t size,
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "check poll nesting");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
if (ERROR_OK != usbtoxxx_ensure_buffer_size(3 + 4 + 2 * size))
|
||||
if (usbtoxxx_ensure_buffer_size(3 + 4 + 2 * size) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
@@ -504,10 +504,10 @@ RESULT usbtopoll_verifybuff(uint16_t offset, uint16_t size, uint8_t *buff)
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "check poll nesting");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
if (ERROR_OK != usbtoxxx_ensure_buffer_size(3 + 5 + size))
|
||||
if (usbtoxxx_ensure_buffer_size(3 + 5 + size) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
@@ -527,10 +527,10 @@ RESULT usbtopoll_verifybuff(uint16_t offset, uint16_t size, uint8_t *buff)
|
||||
|
||||
RESULT usbtodelay_delay(uint16_t dly)
|
||||
{
|
||||
if (ERROR_OK != usbtoxxx_ensure_buffer_size(3 + 2))
|
||||
if (usbtoxxx_ensure_buffer_size(3 + 2) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
|
||||
if (usbtoxxx_validate_current_command_type() != ERROR_OK) {
|
||||
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ RESULT versaloon_send_command(uint16_t out_len, uint16_t *inlen)
|
||||
LOG_BUG(ERRMSG_INVALID_BUFFER, TO_STR(versaloon_buf));
|
||||
return ERRCODE_INVALID_BUFFER;
|
||||
}
|
||||
if ((0 == out_len) || (out_len > versaloon_interface.usb_setting.buf_size)) {
|
||||
if ((out_len == 0) || (out_len > versaloon_interface.usb_setting.buf_size)) {
|
||||
LOG_BUG(ERRMSG_INVALID_PARAMETER, __func__);
|
||||
return ERRCODE_INVALID_PARAMETER;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ RESULT versaloon_send_command(uint16_t out_len, uint16_t *inlen)
|
||||
versaloon_interface.usb_setting.ep_in,
|
||||
versaloon_buf, versaloon_interface.usb_setting.buf_size,
|
||||
&transferred, versaloon_usb_to);
|
||||
if (0 == ret) {
|
||||
if (ret == 0) {
|
||||
*inlen = (uint16_t)transferred;
|
||||
return ERROR_OK;
|
||||
} else {
|
||||
@@ -254,7 +254,7 @@ static RESULT versaloon_init(void)
|
||||
versaloon_usb_to = 100;
|
||||
for (retry = 0; retry < VERSALOON_RETRY_CNT; retry++) {
|
||||
versaloon_buf[0] = VERSALOON_GET_INFO;
|
||||
if ((ERROR_OK == versaloon_send_command(1, &ret)) && (ret >= 3))
|
||||
if ((versaloon_send_command(1, &ret) == ERROR_OK) && (ret >= 3))
|
||||
break;
|
||||
}
|
||||
versaloon_usb_to = timeout_tmp;
|
||||
@@ -285,7 +285,7 @@ static RESULT versaloon_init(void)
|
||||
LOG_ERROR(ERRMSG_NOT_ENOUGH_MEMORY);
|
||||
return ERRCODE_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
if (ERROR_OK != usbtoxxx_init()) {
|
||||
if (usbtoxxx_init() != ERROR_OK) {
|
||||
LOG_ERROR(ERRMSG_FAILURE_OPERATION, "initialize usbtoxxx");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -337,7 +337,7 @@ static RESULT versaloon_get_target_voltage(uint16_t *voltage)
|
||||
|
||||
versaloon_buf[0] = VERSALOON_GET_TVCC;
|
||||
|
||||
if ((ERROR_OK != versaloon_send_command(1, &inlen)) || (inlen != 2)) {
|
||||
if ((versaloon_send_command(1, &inlen) != ERROR_OK) || (inlen != 2)) {
|
||||
LOG_ERROR(ERRMSG_FAILURE_OPERATION, "communicate with versaloon");
|
||||
return ERRCODE_FAILURE_OPERATION;
|
||||
} else {
|
||||
|
||||
@@ -287,7 +287,7 @@ static int vsllink_interface_init(void)
|
||||
|
||||
libusb_init(&vsllink_handle->libusb_ctx);
|
||||
|
||||
if (ERROR_OK != vsllink_usb_open(vsllink_handle)) {
|
||||
if (vsllink_usb_open(vsllink_handle) != ERROR_OK) {
|
||||
LOG_ERROR("Can't find USB JTAG Interface!"
|
||||
"Please check connection and permissions.");
|
||||
return ERROR_JTAG_INIT_FAILED;
|
||||
@@ -297,7 +297,7 @@ static int vsllink_interface_init(void)
|
||||
versaloon_interface.usb_setting.pid);
|
||||
versaloon_usb_device_handle = vsllink_handle->usb_device_handle;
|
||||
|
||||
if (ERROR_OK != versaloon_interface.init())
|
||||
if (versaloon_interface.init() != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
if (versaloon_interface.usb_setting.buf_size < 32) {
|
||||
versaloon_interface.fini();
|
||||
@@ -344,7 +344,7 @@ static int vsllink_init(void)
|
||||
GPIO_TRST, GPIO_SRST, GPIO_SRST);
|
||||
}
|
||||
|
||||
if (ERROR_OK != versaloon_interface.adaptors.peripheral_commit())
|
||||
if (versaloon_interface.adaptors.peripheral_commit() != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
vsllink_reset(0, 0);
|
||||
|
||||
@@ -341,7 +341,7 @@ static bool usb_connect(void)
|
||||
/* Initialize libusb context */
|
||||
result = libusb_init(&ctx);
|
||||
|
||||
if (0 == result) {
|
||||
if (result == 0) {
|
||||
/* Get list of USB devices attached to system */
|
||||
count = libusb_get_device_list(ctx, &list);
|
||||
if (count <= 0) {
|
||||
@@ -350,7 +350,7 @@ static bool usb_connect(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == result) {
|
||||
if (result == 0) {
|
||||
/* Scan through list of devices for any XDS110s */
|
||||
for (i = 0; i < count; i++) {
|
||||
/* Check for device vid/pid match */
|
||||
@@ -365,13 +365,13 @@ static bool usb_connect(void)
|
||||
}
|
||||
if (match) {
|
||||
result = libusb_open(list[i], &dev);
|
||||
if (0 == result) {
|
||||
if (result == 0) {
|
||||
const int max_data = 256;
|
||||
unsigned char data[max_data + 1];
|
||||
*data = '\0';
|
||||
|
||||
/* May be the requested device if serial number matches */
|
||||
if (0 == xds110.serial[0]) {
|
||||
if (xds110.serial[0] == 0) {
|
||||
/* No serial number given; match first XDS110 found */
|
||||
found = true;
|
||||
break;
|
||||
@@ -430,7 +430,7 @@ static bool usb_connect(void)
|
||||
}
|
||||
|
||||
/* On an error, clean up what we can */
|
||||
if (0 != result) {
|
||||
if (result != 0) {
|
||||
if (dev) {
|
||||
/* Release the debug and data interface on the XDS110 */
|
||||
(void)libusb_release_interface(dev, xds110.interface);
|
||||
@@ -443,12 +443,12 @@ static bool usb_connect(void)
|
||||
}
|
||||
|
||||
/* Log the results */
|
||||
if (0 == result)
|
||||
if (result == 0)
|
||||
LOG_INFO("XDS110: connected");
|
||||
else
|
||||
LOG_ERROR("XDS110: failed to connect");
|
||||
|
||||
return (0 == result) ? true : false;
|
||||
return (result == 0) ? true : false;
|
||||
}
|
||||
|
||||
static void usb_disconnect(void)
|
||||
@@ -476,13 +476,13 @@ static bool usb_read(unsigned char *buffer, int size, int *bytes_read,
|
||||
return false;
|
||||
|
||||
/* Force a non-zero timeout to prevent blocking */
|
||||
if (0 == timeout)
|
||||
if (timeout == 0)
|
||||
timeout = DEFAULT_TIMEOUT;
|
||||
|
||||
result = libusb_bulk_transfer(xds110.dev, xds110.endpoint_in, buffer, size,
|
||||
bytes_read, timeout);
|
||||
|
||||
return (0 == result) ? true : false;
|
||||
return (result == 0) ? true : false;
|
||||
}
|
||||
|
||||
static bool usb_write(unsigned char *buffer, int size, int *written)
|
||||
@@ -671,7 +671,7 @@ static bool xds_execute(uint32_t out_length, uint32_t in_length,
|
||||
if (!success)
|
||||
error = SC_ERR_XDS110_FAIL;
|
||||
|
||||
if (0 != error)
|
||||
if (error != 0)
|
||||
success = false;
|
||||
|
||||
return success;
|
||||
@@ -1280,7 +1280,7 @@ static int xds110_swd_run_queue(void)
|
||||
uint32_t value;
|
||||
bool success = true;
|
||||
|
||||
if (0 == xds110.txn_request_size)
|
||||
if (xds110.txn_request_size == 0)
|
||||
return ERROR_OK;
|
||||
|
||||
/* Terminate request queue */
|
||||
@@ -1316,7 +1316,7 @@ static int xds110_swd_run_queue(void)
|
||||
|
||||
/* Transfer results into caller's buffers */
|
||||
for (result = 0; result < xds110.txn_result_count; result++)
|
||||
if (0 != xds110.txn_dap_results[result])
|
||||
if (xds110.txn_dap_results[result] != 0)
|
||||
*xds110.txn_dap_results[result] = dap_results[result];
|
||||
|
||||
xds110.txn_request_size = 0;
|
||||
@@ -1395,7 +1395,7 @@ static void xds110_show_info(void)
|
||||
(((firmware >> 12) & 0xf) * 10) + ((firmware >> 8) & 0xf),
|
||||
(((firmware >> 4) & 0xf) * 10) + ((firmware >> 0) & 0xf));
|
||||
LOG_INFO("XDS110: hardware version = 0x%04x", xds110.hardware);
|
||||
if (0 != xds110.serial[0])
|
||||
if (xds110.serial[0] != 0)
|
||||
LOG_INFO("XDS110: serial number = %s", xds110.serial);
|
||||
if (xds110.is_swd_mode) {
|
||||
LOG_INFO("XDS110: connected to target via SWD");
|
||||
@@ -1470,12 +1470,12 @@ static int xds110_init(void)
|
||||
|
||||
if (success) {
|
||||
/* Set supply voltage for stand-alone probes */
|
||||
if (XDS110_STAND_ALONE_ID == xds110.hardware) {
|
||||
if (xds110.hardware == XDS110_STAND_ALONE_ID) {
|
||||
success = xds_set_supply(xds110.voltage);
|
||||
/* Allow time for target device to power up */
|
||||
/* (CC32xx takes up to 1300 ms before debug is enabled) */
|
||||
alive_sleep(1500);
|
||||
} else if (0 != xds110.voltage) {
|
||||
} else if (xds110.voltage != 0) {
|
||||
/* Voltage supply not a feature of embedded probes */
|
||||
LOG_WARNING(
|
||||
"XDS110: ignoring supply voltage, not supported on this probe");
|
||||
@@ -1557,7 +1557,7 @@ static void xds110_flush(void)
|
||||
uint8_t data_in[MAX_DATA_BLOCK];
|
||||
uint8_t *data_pntr;
|
||||
|
||||
if (0 == xds110.txn_request_size)
|
||||
if (xds110.txn_request_size == 0)
|
||||
return;
|
||||
|
||||
/* Terminate request queue */
|
||||
|
||||
Reference in New Issue
Block a user