target/arm946e: change prototype of arm946e_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 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: jenkinsbscan_optimization
parent
2f3ab89a78
commit
c734202dc8
|
@ -99,11 +99,11 @@ static int arm946e_target_create(struct target *target, Jim_Interp *interp)
|
||||||
return ERROR_OK;
|
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)
|
struct arm946e_common *arm946e)
|
||||||
{
|
{
|
||||||
if (arm946e->common_magic != ARM946E_COMMON_MAGIC) {
|
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_TARGET_INVALID;
|
||||||
}
|
}
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
|
@ -558,7 +558,7 @@ COMMAND_HANDLER(arm946e_handle_cp15)
|
||||||
struct target *target = get_current_target(CMD_CTX);
|
struct target *target = get_current_target(CMD_CTX);
|
||||||
|
|
||||||
struct arm946e_common *arm946e = target_to_arm946(target);
|
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)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -608,7 +608,7 @@ COMMAND_HANDLER(arm946e_handle_idcache)
|
||||||
struct target *target = get_current_target(CMD_CTX);
|
struct target *target = get_current_target(CMD_CTX);
|
||||||
struct arm946e_common *arm946e = target_to_arm946(target);
|
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)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue