target/arm720t: change prototype of arm720t_verify_pointer()

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 arm720t_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: I7fa0628fabacd9ceb62ce921192f88edca659c15
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/5059
Tested-by: jenkins
bscan_optimization
Paul Fertser 2019-04-01 04:44:43 +02:00 committed by Tomas Vanek
parent 6a453e5cf0
commit 2f3ab89a78
1 changed files with 3 additions and 3 deletions

View File

@ -233,11 +233,11 @@ static void arm720t_pre_restore_context(struct target *target)
arm720t_write_cp15(target, 0xee060f10, arm720t->far_reg); arm720t_write_cp15(target, 0xee060f10, arm720t->far_reg);
} }
static int arm720t_verify_pointer(struct command_context *cmd_ctx, static int arm720t_verify_pointer(struct command_invocation *cmd,
struct arm720t_common *arm720t) struct arm720t_common *arm720t)
{ {
if (arm720t->common_magic != ARM720T_COMMON_MAGIC) { if (arm720t->common_magic != ARM720T_COMMON_MAGIC) {
command_print(cmd_ctx, "target is not an ARM720"); command_print(cmd->ctx, "target is not an ARM720");
return ERROR_TARGET_INVALID; return ERROR_TARGET_INVALID;
} }
return ERROR_OK; return ERROR_OK;
@ -442,7 +442,7 @@ COMMAND_HANDLER(arm720t_handle_cp15_command)
struct target *target = get_current_target(CMD_CTX); struct target *target = get_current_target(CMD_CTX);
struct arm720t_common *arm720t = target_to_arm720(target); struct arm720t_common *arm720t = target_to_arm720(target);
retval = arm720t_verify_pointer(CMD_CTX, arm720t); retval = arm720t_verify_pointer(CMD, arm720t);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;