From: OpenOCD-Gerrit <ope...@us...> - 2022-09-23 21:25:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via aff48a6a31019af17959a7da33909d1cea6de61a (commit) via ea9089944e509ba301f5a2ca14b30eb5d7a90f44 (commit) from aa57890554cb4f8b4ccf35a69598238a12a79069 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit aff48a6a31019af17959a7da33909d1cea6de61a Author: Antonio Borneo <bor...@gm...> Date: Mon Sep 19 15:02:36 2022 +0200 target/riscv: fix dead assignment Scan-build reports: Unused code: Dead nested assignment riscv.c:459 Although the value stored to 'ir_user4_raw' is used in the enclosing expression, the value is never actually read from 'ir_user4_raw' This is caused by the value reassigned in 'ir_user4_raw': riscv.c:459 ir_user4[3] = (uint8_t)(ir_user4_raw >>= 8); but never used. Drop the DIY conversion in favor of h_u32_to_le() that does not reassign the input value. Change-Id: Ifad29f4c46d4a2d0a2f5a5c4104d768cc3db2794 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7208 Reviewed-by: Tim Newsome <ti...@si...> Reviewed-by: Jan Matyas <ma...@co...> Tested-by: jenkins diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index c25efcde9..5444fca01 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -453,10 +453,7 @@ static int riscv_init_target(struct command_context *cmd_ctx, if (bscan_tunnel_ir_width != 0) { assert(target->tap->ir_length >= 6); uint32_t ir_user4_raw = 0x23 << (target->tap->ir_length - 6); - ir_user4[0] = (uint8_t)ir_user4_raw; - ir_user4[1] = (uint8_t)(ir_user4_raw >>= 8); - ir_user4[2] = (uint8_t)(ir_user4_raw >>= 8); - ir_user4[3] = (uint8_t)(ir_user4_raw >>= 8); + h_u32_to_le(ir_user4, ir_user4_raw); select_user4.num_bits = target->tap->ir_length; bscan_tunneled_ir_width[0] = bscan_tunnel_ir_width; if (bscan_tunnel_type == BSCAN_TUNNEL_DATA_REGISTER) commit ea9089944e509ba301f5a2ca14b30eb5d7a90f44 Author: Antonio Borneo <bor...@gm...> Date: Mon Sep 19 14:55:55 2022 +0200 target/riscv: fix unused initialization Scan-build reports: Unused code: Dead assignment riscv.c:716 Value stored to 'result' is never read Remove the initialization of variable 'result'. Change-Id: Ied67bb4fcfa5bace186522074247ead43a5d5cd5 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7207 Reviewed-by: Tim Newsome <ti...@si...> Reviewed-by: Jan Matyas <ma...@co...> Tested-by: jenkins diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index dde3d7e69..c25efcde9 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -713,7 +713,6 @@ static int add_trigger(struct target *target, struct trigger *trigger) return result; int type = get_field(tdata1, MCONTROL_TYPE(riscv_xlen(target))); - result = ERROR_OK; switch (type) { case 1: result = maybe_add_trigger_t1(target, trigger, tdata1); ----------------------------------------------------------------------- Summary of changes: src/target/riscv/riscv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |