helper/command: change prototype of command_print/command_print_sameline
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should switch to CMD as first parameter. Change prototype of command_print() and command_print_sameline() to pass CMD instead of CMD_CTX. Since the first parameter is currently not used, the change can be done though scripts without manual coding. This patch is created using the command: sed -i PATTERN $(find src/ doc/ -type f) with all the following patters: 's/\(command_print(cmd\)->ctx,/\1,/' 's/\(command_print(CMD\)_CTX,/\1,/' 's/\(command_print(struct command_\)context \*context,/\1invocation *cmd,/' 's/\(command_print_sameline(cmd\)->ctx,/\1,/' 's/\(command_print_sameline(CMD\)_CTX,/\1,/' 's/\(command_print_sameline(struct command_\)context \*context,/\1invocation *cmd,/' This change is inspired by http://openocd.zylin.com/1815 from Paul Fertser but is now done through scripting. Change-Id: I3386d8f96cdc477e7a2308dd18269de3bed04385 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/5081 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Tomas Vanek
parent
6916550938
commit
6cb5ba6f11
@@ -746,7 +746,7 @@ COMMAND_HANDLER(str9xpec_handle_part_id_command)
|
||||
|
||||
idcode = buf_get_u32(buffer, 0, 32);
|
||||
|
||||
command_print(CMD_CTX, "str9xpec part id: 0x%8.8" PRIx32 "", idcode);
|
||||
command_print(CMD, "str9xpec part id: 0x%8.8" PRIx32 "", idcode);
|
||||
|
||||
free(buffer);
|
||||
|
||||
@@ -780,33 +780,33 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_read_command)
|
||||
|
||||
/* boot bank */
|
||||
if (buf_get_u32(str9xpec_info->options, STR9XPEC_OPT_CSMAPBIT, 1))
|
||||
command_print(CMD_CTX, "CS Map: bank1");
|
||||
command_print(CMD, "CS Map: bank1");
|
||||
else
|
||||
command_print(CMD_CTX, "CS Map: bank0");
|
||||
command_print(CMD, "CS Map: bank0");
|
||||
|
||||
/* OTP lock */
|
||||
if (buf_get_u32(str9xpec_info->options, STR9XPEC_OPT_OTPBIT, 1))
|
||||
command_print(CMD_CTX, "OTP Lock: OTP Locked");
|
||||
command_print(CMD, "OTP Lock: OTP Locked");
|
||||
else
|
||||
command_print(CMD_CTX, "OTP Lock: OTP Unlocked");
|
||||
command_print(CMD, "OTP Lock: OTP Unlocked");
|
||||
|
||||
/* LVD Threshold */
|
||||
if (buf_get_u32(str9xpec_info->options, STR9XPEC_OPT_LVDTHRESBIT, 1))
|
||||
command_print(CMD_CTX, "LVD Threshold: 2.7v");
|
||||
command_print(CMD, "LVD Threshold: 2.7v");
|
||||
else
|
||||
command_print(CMD_CTX, "LVD Threshold: 2.4v");
|
||||
command_print(CMD, "LVD Threshold: 2.4v");
|
||||
|
||||
/* LVD reset warning */
|
||||
if (buf_get_u32(str9xpec_info->options, STR9XPEC_OPT_LVDWARNBIT, 1))
|
||||
command_print(CMD_CTX, "LVD Reset Warning: VDD or VDDQ Inputs");
|
||||
command_print(CMD, "LVD Reset Warning: VDD or VDDQ Inputs");
|
||||
else
|
||||
command_print(CMD_CTX, "LVD Reset Warning: VDD Input Only");
|
||||
command_print(CMD, "LVD Reset Warning: VDD Input Only");
|
||||
|
||||
/* LVD reset select */
|
||||
if (buf_get_u32(str9xpec_info->options, STR9XPEC_OPT_LVDSELBIT, 1))
|
||||
command_print(CMD_CTX, "LVD Reset Selection: VDD or VDDQ Inputs");
|
||||
command_print(CMD, "LVD Reset Selection: VDD or VDDQ Inputs");
|
||||
else
|
||||
command_print(CMD_CTX, "LVD Reset Selection: VDD Input Only");
|
||||
command_print(CMD, "LVD Reset Selection: VDD Input Only");
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -885,7 +885,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_write_command)
|
||||
if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
|
||||
return ERROR_FLASH_OPERATION_FAILED;
|
||||
|
||||
command_print(CMD_CTX, "str9xpec write options complete.\n"
|
||||
command_print(CMD, "str9xpec write options complete.\n"
|
||||
"INFO: a reset or power cycle is required "
|
||||
"for the new settings to take effect.");
|
||||
|
||||
@@ -1017,7 +1017,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_unlock_command)
|
||||
if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
|
||||
return ERROR_FLASH_OPERATION_FAILED;
|
||||
|
||||
command_print(CMD_CTX, "str9xpec unlocked.\n"
|
||||
command_print(CMD, "str9xpec unlocked.\n"
|
||||
"INFO: a reset or power cycle is required "
|
||||
"for the new settings to take effect.");
|
||||
|
||||
@@ -1045,19 +1045,19 @@ COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command)
|
||||
tap0 = str9xpec_info->tap;
|
||||
if (tap0 == NULL) {
|
||||
/* things are *WRONG* */
|
||||
command_print(CMD_CTX, "**STR9FLASH** (tap0) invalid chain?");
|
||||
command_print(CMD, "**STR9FLASH** (tap0) invalid chain?");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
tap1 = tap0->next_tap;
|
||||
if (tap1 == NULL) {
|
||||
/* things are *WRONG* */
|
||||
command_print(CMD_CTX, "**STR9FLASH** (tap1) invalid chain?");
|
||||
command_print(CMD, "**STR9FLASH** (tap1) invalid chain?");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
tap2 = tap1->next_tap;
|
||||
if (tap2 == NULL) {
|
||||
/* things are *WRONG* */
|
||||
command_print(CMD_CTX, "**STR9FLASH** (tap2) invalid chain?");
|
||||
command_print(CMD, "**STR9FLASH** (tap2) invalid chain?");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user