This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9083

-- gerrit

commit af4eef2668dee259ce3a0ca89ca78e0af38078a5
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Thu Aug 14 22:18:56 2025 +0200

    helper: command: inline command_retval_set()
    
    Inline the function command_retval_set(), called only once.
    No functional changes.
    
    Change-Id: I4478002adf92c2328e4879019020de5d1dfe89c8
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/helper/command.c b/src/helper/command.c
index 04f4f9a54c..d6993ab76f 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -63,15 +63,6 @@ void *jimcmd_privdata(Jim_Cmd *cmd)
        return jimcmd_is_proc(cmd) ? NULL : cmd->u.native.privData;
 }
 
-static int command_retval_set(Jim_Interp *interp, int retval)
-{
-       int *return_retval = Jim_GetAssocData(interp, "retval");
-       if (return_retval)
-               *return_retval = retval;
-
-       return (retval == ERROR_OK) ? JIM_OK : retval;
-}
-
 extern struct command_context *global_cmd_ctx;
 
 /* dump a single line to the log for the command.
@@ -475,7 +466,15 @@ static int exec_command(Jim_Interp *interp, struct 
command_context *context,
        Jim_DecrRefCount(context->interp, cmd.output);
 
        free(words);
-       return command_retval_set(interp, retval);
+
+       int *return_retval = Jim_GetAssocData(interp, "retval");
+       if (return_retval)
+               *return_retval = retval;
+
+       if (retval == ERROR_OK)
+               return JIM_OK;
+
+       return retval;
 }
 
 int command_run_line(struct command_context *context, char *line)

-- 

Reply via email to