diff options
author | Marc Schink <dev@zapb.de> | 2021-01-26 09:15:47 +0100 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-03-10 21:30:04 +0000 |
commit | 02abae8cdf339d18b441ed152d8a8d17209341b1 (patch) | |
tree | 3b7e4c343df6d4a19af9a8606f9c8fcfbfbe0e58 | |
parent | 5fd78b0523d81c00100e02e1aed0990624ff56c8 (diff) | |
download | riscv-openocd-02abae8cdf339d18b441ed152d8a8d17209341b1.zip riscv-openocd-02abae8cdf339d18b441ed152d8a8d17209341b1.tar.gz riscv-openocd-02abae8cdf339d18b441ed152d8a8d17209341b1.tar.bz2 |
target/mips: Remove typedef'd struct
The C style guide forbids typedef'd structs, see 'Naming Rules'.
Change-Id: I449590251056c478c05105cdc18014ab4eb77ed8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6033
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r-- | src/target/mips32_pracc.c | 2 | ||||
-rw-r--r-- | src/target/mips32_pracc.h | 6 | ||||
-rw-r--r-- | src/target/mips64_pracc.c | 10 | ||||
-rw-r--r-- | src/target/mips_ejtag.c | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index d6bd1c5..f8643fa 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -317,7 +317,7 @@ void pracc_add(struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr) if (ctx->retval != ERROR_OK) /* On previous out of memory, return */ return; if (ctx->code_count == ctx->max_code) { - void *p = realloc(ctx->pracc_list, sizeof(pa_list) * (ctx->max_code + PRACC_BLOCK)); + void *p = realloc(ctx->pracc_list, sizeof(struct pa_list) * (ctx->max_code + PRACC_BLOCK)); if (p) { ctx->max_code += PRACC_BLOCK; ctx->pracc_list = p; diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h index 911a69c..30edaec 100644 --- a/src/target/mips32_pracc.h +++ b/src/target/mips32_pracc.h @@ -47,10 +47,10 @@ #define PRACC_BLOCK 128 /* 1 Kbyte */ -typedef struct { +struct pa_list { uint32_t instr; uint32_t addr; -} pa_list; +}; struct pracc_queue_info { struct mips_ejtag *ejtag_info; @@ -59,7 +59,7 @@ struct pracc_queue_info { int code_count; int store_count; int max_code; /* max instructions with currently allocated memory */ - pa_list *pracc_list; /* Code and store addresses at dmseg */ + struct pa_list *pracc_list; /* Code and store addresses at dmseg */ }; void pracc_queue_init(struct pracc_queue_info *ctx); diff --git a/src/target/mips64_pracc.c b/src/target/mips64_pracc.c index 3080046..dbad248 100644 --- a/src/target/mips64_pracc.c +++ b/src/target/mips64_pracc.c @@ -24,7 +24,7 @@ #define STACK_DEPTH 32 -typedef struct { +struct mips64_pracc_context { uint64_t *local_iparam; unsigned num_iparam; uint64_t *local_oparam; @@ -34,7 +34,7 @@ typedef struct { uint64_t stack[STACK_DEPTH]; unsigned stack_offset; struct mips_ejtag *ejtag_info; -} mips64_pracc_context; +}; static int wait_for_pracc_rw(struct mips_ejtag *ejtag_info, uint32_t *ctrl) { @@ -61,7 +61,7 @@ static int wait_for_pracc_rw(struct mips_ejtag *ejtag_info, uint32_t *ctrl) return ERROR_OK; } -static int mips64_pracc_exec_read(mips64_pracc_context *ctx, uint64_t address) +static int mips64_pracc_exec_read(struct mips64_pracc_context *ctx, uint64_t address) { struct mips_ejtag *ejtag_info = ctx->ejtag_info; unsigned offset; @@ -149,7 +149,7 @@ static int mips64_pracc_exec_read(mips64_pracc_context *ctx, uint64_t address) return jtag_execute_queue(); } -static int mips64_pracc_exec_write(mips64_pracc_context *ctx, uint64_t address) +static int mips64_pracc_exec_write(struct mips64_pracc_context *ctx, uint64_t address) { uint32_t ejtag_ctrl; uint64_t data; @@ -214,7 +214,7 @@ int mips64_pracc_exec(struct mips_ejtag *ejtag_info, { uint32_t ejtag_ctrl; uint64_t address = 0, address_prev = 0, data; - mips64_pracc_context ctx; + struct mips64_pracc_context ctx; int retval; int pass = 0; bool first_time_call = true; diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c index 4b049fb..d4c019f 100644 --- a/src/target/mips_ejtag.c +++ b/src/target/mips_ejtag.c @@ -268,7 +268,7 @@ error: int mips_ejtag_exit_debug(struct mips_ejtag *ejtag_info) { - pa_list pracc_list = {.instr = MIPS32_DRET(ejtag_info->isa), .addr = 0}; + struct pa_list pracc_list = {.instr = MIPS32_DRET(ejtag_info->isa), .addr = 0}; struct pracc_queue_info ctx = {.max_code = 1, .pracc_list = &pracc_list, .code_count = 1, .store_count = 0}; /* execute our dret instruction */ |