return ERROR_JTAG_INIT_FAILED;
}
- use_usb_location = (jtag_usb_get_location() != NULL);
+ use_usb_location = !!jtag_usb_get_location();
if (!use_serial_number && !use_usb_address && !use_usb_location && num_devices > 1) {
LOG_ERROR("Multiple devices found, specify the desired device");
found = 0;
do {
if (head->target->coreid == next->core_id) {
-
target = head->target;
found = 1;
- } else
- head = head->next;
-
- } while ((head != (struct target_list *)NULL) && (found == 0));
+ break;
+ }
+ head = head->next;
+ } while (head);
if (found == 0) {
LOG_ERROR
ctt = ctt->next;
}
- while (head != (struct target_list *)NULL) {
+ while (head) {
struct reg **reg_list;
int reg_list_size;
int retval;
struct current_thread *ct;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
if (head->target->rtos != rtos) {
struct linux_os *smp_os_linux =
(struct linux_os *)head->target->rtos->rtos_specific_params;
uint64_t addr = 0;
size_t reply_len;
char reply[GDB_BUFFER_SIZE + 1], cur_sym[GDB_BUFFER_SIZE / 2 + 1] = ""; /* Extra byte for null-termination */
- struct symbol_table_elem *next_sym = NULL;
+ struct symbol_table_elem *next_sym;
struct target *target = get_target_from_connection(connection);
struct rtos *os = target->rtos;
next_sym = next_symbol(os, cur_sym, addr);
/* Should never happen unless the debugger misbehaves */
- if (next_sym == NULL) {
+ if (!next_sym) {
LOG_WARNING("RTOS: Debugger sent us qSymbol with '%s' that we did not ask for", cur_sym);
goto done;
}
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);
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;
armv7a->armv7a_mmu.armv7a_cache.outer_cache = l2x_cache;
/* initialize all target in this cluster (smp target)
* l2 cache must be configured after smp declaration */
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
if (curr != target) {
armv7a = target_to_armv7a(curr);
struct target_list *head;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
if (curr->state == TARGET_HALTED)
retval = armv7a_l1_d_cache_clean_inval_all(curr);
/* initialize all targets in this cluster (smp target)
* l2 cache must be configured after smp declaration */
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
if (curr != target) {
armv7a = target_to_armv7a(curr);
struct target_list *head;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
if (curr->state == TARGET_HALTED) {
LOG_INFO("Wait flushing data l1 on core %" PRId32, curr->coreid);
if (type == BKPT_SOFT)
return breakpoint_add_internal(head->target, address, length, type);
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
retval = breakpoint_add_internal(curr, address, length, type);
if (retval != ERROR_OK)
struct target_list *head;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
retval = context_breakpoint_add_internal(curr, asid, length, type);
if (retval != ERROR_OK)
struct target_list *head;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
retval = hybrid_breakpoint_add_internal(curr, address, asid, length, type);
if (retval != ERROR_OK)
struct target_list *head;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
num_breakpoints += breakpoint_remove_internal(curr, address);
head = head->next;
struct target_list *head;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
breakpoint_remove_all_internal(curr);
head = head->next;
struct target_list *head;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
breakpoint_clear_target_internal(curr);
head = head->next;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
if ((curr->coreid == coreid) && (curr->state == TARGET_HALTED))
return curr;
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->state != TARGET_HALTED)
&& target_was_examined(curr))
struct target *curr;
target_addr_t address;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
if ((curr != target) && (curr->state != TARGET_RUNNING)
&& target_was_examined(curr)) {
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
curr = head->target;
if ((curr->coreid == coreid) && (curr->state == TARGET_HALTED))
return curr;
struct target_list *head;
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
int ret = ERROR_OK;
curr = head->target;
if ((curr != target) && (curr->state != TARGET_HALTED))
struct target *curr;
head = target->head;
- while (head != (struct target_list *)NULL) {
+ while (head) {
int ret = ERROR_OK;
curr = head->target;
if ((curr != target) && (curr->state != TARGET_RUNNING)) {
int retval = ERROR_OK;
struct target_list *head;
head = target->head;
- if (head != (struct target_list *)NULL) {
+ if (head) {
if (CMD_ARGC == 1) {
int coreid = 0;
COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], coreid);
new = malloc(sizeof(struct target_list));
new->target = target;
new->next = (struct target_list *)NULL;
- if (head == (struct target_list *)NULL) {
+ if (!head) {
head = new;
curr = head;
} else {
/* now parse the list of cpu and put the target in smp mode*/
curr = head;
- while (curr != (struct target_list *)NULL) {
+ while (curr) {
target = curr->target;
target->smp = 1;
target->head = head;