This is an automated email from Gerrit. "Antonio Borneo <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9551
-- gerrit commit 9236444d42722c6da0bb66d6e4a50e07a368b75c Author: Antonio Borneo <[email protected]> Date: Sun Mar 29 18:15:10 2026 +0200 openocd: drop variable for constant return value Pattern detected with coccinelle script in Linux code scripts/coccinelle/misc/returnvar.cocci Change-Id: Ib28b5034f6e9881f2569dc88e7cf4810662a0845 Signed-off-by: Antonio Borneo <[email protected]> diff --git a/src/flash/nor/aducm360.c b/src/flash/nor/aducm360.c index aa573acded..a5fd2cd249 100644 --- a/src/flash/nor/aducm360.c +++ b/src/flash/nor/aducm360.c @@ -440,7 +440,6 @@ static int aducm360_write_modified(struct flash_bank *bank, uint32_t count) { uint32_t value; - int res = ERROR_OK; uint32_t i, j, a, d; struct target *target = bank->target; @@ -464,7 +463,7 @@ static int aducm360_write_modified(struct flash_bank *bank, } aducm360_set_write_enable(target, 0); - return res; + return ERROR_OK; } /* ----------------------------------------------------------------------- */ diff --git a/src/flash/nor/tms470.c b/src/flash/nor/tms470.c index fa0b5b68ec..1c8432a205 100644 --- a/src/flash/nor/tms470.c +++ b/src/flash/nor/tms470.c @@ -490,7 +490,6 @@ static int tms470_flash_initialize_internal_state_machine(struct flash_bank *ban uint32_t fmmac2, fmmac1, fmmaxep, k, delay, glbctrl, sysclk; struct target *target = bank->target; struct tms470_flash_bank *tms470_info = bank->driver_priv; - int result = ERROR_OK; /* * Select the desired bank to be programmed by writing BANK[2:0] of @@ -613,7 +612,7 @@ static int tms470_flash_initialize_internal_state_machine(struct flash_bank *ban target_write_u32(target, 0xFFE8A054, delay * 5400); LOG_DEBUG("set fmewidth = 0x%04" PRIx32, delay * 5400); - return result; + return ERROR_OK; } /* ---------------------------------------------------------------------- */ diff --git a/src/rtos/ecos.c b/src/rtos/ecos.c index 41159bf094..120b50685e 100644 --- a/src/rtos/ecos.c +++ b/src/rtos/ecos.c @@ -659,8 +659,6 @@ static int ecos_stack_layout_cortexm(struct rtos *rtos, static int ecos_stack_layout_arm(struct rtos *rtos, struct ecos_params *param, int64_t stack_ptr, const struct rtos_register_stacking **si) { - int retval = ERROR_OK; - if (!param->stacking_info && ecos_value(rtos, ECOS_VAL_ARM_REGSIZE)) { /* When OpenOCD is extended to allow FPU registers to be returned from a * stacked thread context we can check: @@ -695,7 +693,7 @@ static int ecos_stack_layout_arm(struct rtos *rtos, struct ecos_params *param, if (si) *si = param->stacking_info; - return retval; + return ERROR_OK; } /* We see this function called on a new connection, it looks like before and --
