target/arm946e: change prototype of arm946e_verify_pointer() 60/5060/2
authorPaul Fertser <fercerpav@gmail.com>
Mon, 1 Apr 2019 02:46:29 +0000 (04:46 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Tue, 14 May 2019 18:34:43 +0000 (19:34 +0100)
To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of arm946e_verify_pointer() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ib7119e2b009d05eec47b50c3b9d32feaebc97538
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5060
Tested-by: jenkins
src/target/arm946e.c

index 0733814..278a70c 100644 (file)
@@ -99,11 +99,11 @@ static int arm946e_target_create(struct target *target, Jim_Interp *interp)
        return ERROR_OK;
 }
 
-static int arm946e_verify_pointer(struct command_context *cmd_ctx,
+static int arm946e_verify_pointer(struct command_invocation *cmd,
        struct arm946e_common *arm946e)
 {
        if (arm946e->common_magic != ARM946E_COMMON_MAGIC) {
-               command_print(cmd_ctx, "target is not an ARM946");
+               command_print(cmd->ctx, "target is not an ARM946");
                return ERROR_TARGET_INVALID;
        }
        return ERROR_OK;
@@ -558,7 +558,7 @@ COMMAND_HANDLER(arm946e_handle_cp15)
        struct target *target = get_current_target(CMD_CTX);
 
        struct arm946e_common *arm946e = target_to_arm946(target);
-       int retval = arm946e_verify_pointer(CMD_CTX, arm946e);
+       int retval = arm946e_verify_pointer(CMD, arm946e);
        if (retval != ERROR_OK)
                return retval;
 
@@ -608,7 +608,7 @@ COMMAND_HANDLER(arm946e_handle_idcache)
        struct target *target = get_current_target(CMD_CTX);
        struct arm946e_common *arm946e = target_to_arm946(target);
 
-       retval = arm946e_verify_pointer(CMD_CTX, arm946e);
+       retval = arm946e_verify_pointer(CMD, arm946e);
        if (retval != ERROR_OK)
                return retval;