target/arm926ejs: change prototype of arm926ejs_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 arm926ejs_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: Ibbb03429a7fe8b9979f9bb9e513f9eb86aee3b5b
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/5057
Tested-by: jenkins
bscan_optimization
Paul Fertser 2019-04-01 04:35:04 +02:00 committed by Tomas Vanek
parent fce3b698fb
commit c104617584
1 changed files with 3 additions and 3 deletions

View File

@ -501,11 +501,11 @@ static void arm926ejs_pre_restore_context(struct target *target)
static const char arm926_not[] = "target is not an ARM926"; static const char arm926_not[] = "target is not an ARM926";
static int arm926ejs_verify_pointer(struct command_context *cmd_ctx, static int arm926ejs_verify_pointer(struct command_invocation *cmd,
struct arm926ejs_common *arm926) struct arm926ejs_common *arm926)
{ {
if (arm926->common_magic != ARM926EJS_COMMON_MAGIC) { if (arm926->common_magic != ARM926EJS_COMMON_MAGIC) {
command_print(cmd_ctx, arm926_not); command_print(cmd->ctx, arm926_not);
return ERROR_TARGET_INVALID; return ERROR_TARGET_INVALID;
} }
return ERROR_OK; return ERROR_OK;
@ -729,7 +729,7 @@ COMMAND_HANDLER(arm926ejs_handle_cache_info_command)
struct target *target = get_current_target(CMD_CTX); struct target *target = get_current_target(CMD_CTX);
struct arm926ejs_common *arm926ejs = target_to_arm926(target); struct arm926ejs_common *arm926ejs = target_to_arm926(target);
retval = arm926ejs_verify_pointer(CMD_CTX, arm926ejs); retval = arm926ejs_verify_pointer(CMD, arm926ejs);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;