target/cortex_m: change prototype of cortex_m_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 cortex_m_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: Icf6d1e5f8b4a3ce115c4253e49769df19a5211ae
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/5061
Tested-by: jenkins
bscan_optimization
Paul Fertser 2019-04-01 04:55:27 +02:00 committed by Tomas Vanek
parent c734202dc8
commit 07632ab94c
1 changed files with 5 additions and 5 deletions

View File

@ -2366,11 +2366,11 @@ static int cortex_m_target_create(struct target *target, Jim_Interp *interp)
/*--------------------------------------------------------------------------*/
static int cortex_m_verify_pointer(struct command_context *cmd_ctx,
static int cortex_m_verify_pointer(struct command_invocation *cmd,
struct cortex_m_common *cm)
{
if (cm->common_magic != CORTEX_M_COMMON_MAGIC) {
command_print(cmd_ctx, "target is not a Cortex-M");
command_print(cmd->ctx, "target is not a Cortex-M");
return ERROR_TARGET_INVALID;
}
return ERROR_OK;
@ -2404,7 +2404,7 @@ COMMAND_HANDLER(handle_cortex_m_vector_catch_command)
{ "reset", VC_CORERESET, },
};
retval = cortex_m_verify_pointer(CMD_CTX, cortex_m);
retval = cortex_m_verify_pointer(CMD, cortex_m);
if (retval != ERROR_OK)
return retval;
@ -2482,7 +2482,7 @@ COMMAND_HANDLER(handle_cortex_m_mask_interrupts_command)
const Jim_Nvp *n;
retval = cortex_m_verify_pointer(CMD_CTX, cortex_m);
retval = cortex_m_verify_pointer(CMD, cortex_m);
if (retval != ERROR_OK)
return retval;
@ -2512,7 +2512,7 @@ COMMAND_HANDLER(handle_cortex_m_reset_config_command)
int retval;
char *reset_config;
retval = cortex_m_verify_pointer(CMD_CTX, cortex_m);
retval = cortex_m_verify_pointer(CMD, cortex_m);
if (retval != ERROR_OK)
return retval;