Skip to content

Commit

Permalink
jtag: Use 'unsigned int' for 'abs_chain_position'
Browse files Browse the repository at this point in the history
Change-Id: I1ac0a6a86f820b051619aa132754a69b8f8e0ab9
Signed-off-by: Marc Schink <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8402
Tested-by: jenkins
Reviewed-by: Antonio Borneo <[email protected]>
  • Loading branch information
zapb-0 authored and borneoa committed Aug 2, 2024
1 parent 632df9e commit 4fac138
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/jtag/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ unsigned jtag_tap_count_enabled(void)
/** Append a new TAP to the chain of all taps. */
static void jtag_tap_add(struct jtag_tap *t)
{
unsigned jtag_num_taps = 0;
unsigned int jtag_num_taps = 0;

struct jtag_tap **tap = &__jtag_all_taps;
while (*tap) {
Expand Down Expand Up @@ -1471,7 +1471,7 @@ void jtag_tap_init(struct jtag_tap *tap)
jtag_register_event_callback(&jtag_reset_callback, tap);
jtag_tap_add(tap);

LOG_DEBUG("Created Tap: %s @ abs position %d, "
LOG_DEBUG("Created Tap: %s @ abs position %u, "
"irlen %d, capture: 0x%x mask: 0x%x", tap->dotted_name,
tap->abs_chain_position, tap->ir_length,
(unsigned) tap->ir_capture_value,
Expand Down
4 changes: 2 additions & 2 deletions src/jtag/jtag.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct jtag_tap {
char *chip;
char *tapname;
char *dotted_name;
int abs_chain_position;
unsigned int abs_chain_position;
/** Is this TAP disabled after JTAG reset? */
bool disabled_after_reset;
/** Is this TAP currently enabled? */
Expand Down Expand Up @@ -150,7 +150,7 @@ struct jtag_tap *jtag_all_taps(void);
const char *jtag_tap_name(const struct jtag_tap *tap);
struct jtag_tap *jtag_tap_by_string(const char *dotted_name);
struct jtag_tap *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *obj);
struct jtag_tap *jtag_tap_by_position(unsigned abs_position);
struct jtag_tap *jtag_tap_by_position(unsigned int abs_position);
struct jtag_tap *jtag_tap_next_enabled(struct jtag_tap *p);
unsigned jtag_tap_count_enabled(void);
unsigned jtag_tap_count(void);
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/tcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ COMMAND_HANDLER(handle_scan_chain_command)
expected_mask = buf_get_u32(tap->expected_mask, 0, tap->ir_length);

command_print(CMD,
"%2d %-18s %c 0x%08x %s %5d 0x%02x 0x%02x",
"%2u %-18s %c 0x%08x %s %5d 0x%02x 0x%02x",
tap->abs_chain_position,
tap->dotted_name,
tap->enabled ? 'Y' : 'n',
Expand Down
4 changes: 2 additions & 2 deletions src/target/riscv/riscv-013.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ typedef enum {

typedef struct {
struct list_head list;
int abs_chain_position;
unsigned int abs_chain_position;

/* The number of harts connected to this DM. */
int hart_count;
Expand Down Expand Up @@ -236,7 +236,7 @@ static dm013_info_t *get_dm(struct target *target)
if (info->dm)
return info->dm;

int abs_chain_position = target->tap->abs_chain_position;
unsigned int abs_chain_position = target->tap->abs_chain_position;

dm013_info_t *entry;
dm013_info_t *dm = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/target/xtensa/xtensa_chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static int xtensa_chip_target_create(struct target *target, Jim_Interp *interp)
LOG_DEBUG("DAP: ap_num %" PRId64 " DAP %p\n", pc->ap_num, pc->dap);
} else {
xtensa_chip_dm_cfg.tap = target->tap;
LOG_DEBUG("JTAG: %s:%s pos %d", target->tap->chip, target->tap->tapname,
LOG_DEBUG("JTAG: %s:%s pos %u", target->tap->chip, target->tap->tapname,
target->tap->abs_chain_position);
}

Expand Down

0 comments on commit 4fac138

Please sign in to comment.