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/+/7497

-- gerrit

commit 528573f95f992eb78f8df75ccf3f7d470cda90d7
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Mon Dec 19 18:29:08 2022 +0100

    jtag: rewrite command 'flush_count' as COMMAND_HANDLER
    
    While there:
    - check the number of command parameters;
    - add the mandatory 'usage' field.
    
    Change-Id: I7cd16f049753caedf19f313f7dc84be98efdba42
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index c6ca048104..b3cbc48b49 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -249,12 +249,15 @@ static int jim_command_pathmove(Jim_Interp *interp, int 
argc, Jim_Obj * const *a
        return JIM_OK;
 }
 
-
-static int jim_command_flush_count(Jim_Interp *interp, int argc, Jim_Obj * 
const *args)
+COMMAND_HANDLER(handle_jtag_flush_count)
 {
-       Jim_SetResult(interp, Jim_NewIntObj(interp, 
jtag_get_flush_queue_count()));
+       if (CMD_ARGC != 0)
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
-       return JIM_OK;
+       int count = jtag_get_flush_queue_count();
+       command_print_sameline(CMD, "%d", count);
+
+       return ERROR_OK;
 }
 
 /* REVISIT Just what about these should "move" ... ?
@@ -279,9 +282,10 @@ static const struct command_registration 
jtag_command_handlers_to_move[] = {
        {
                .name = "flush_count",
                .mode = COMMAND_EXEC,
-               .jim_handler = jim_command_flush_count,
+               .handler = handle_jtag_flush_count,
                .help = "Returns the number of times the JTAG queue "
                        "has been flushed.",
+               .usage = "",
        },
        {
                .name = "pathmove",

-- 

Reply via email to