openocd: use single line for register_commands*()

Do not split in multiple lines the calls to register_commands*().
No change in code behaviour, just make it easy to grep in the code
and identify the commands that can be registered.
This would help detecting undocumented commands.

Change-Id: Id654e107cdabf7ee31fc3d227c1d2a59acc5669e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6716
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Antonio Borneo 2021-11-09 00:04:52 +01:00
parent 8d9379c9ba
commit b5d1b719e5
7 changed files with 8 additions and 16 deletions

View File

@ -528,8 +528,7 @@ static COMMAND_HELPER(create_nand_device, const char *bank_name,
}
if (controller->commands) {
retval = register_commands(CMD_CTX, NULL,
controller->commands);
retval = register_commands(CMD_CTX, NULL, controller->commands);
if (retval != ERROR_OK)
return retval;
}

View File

@ -1284,8 +1284,7 @@ COMMAND_HANDLER(handle_flash_bank_command)
/* register flash specific commands */
if (driver->commands) {
int retval = register_commands(CMD_CTX, NULL,
driver->commands);
int retval = register_commands(CMD_CTX, NULL, driver->commands);
if (retval != ERROR_OK) {
LOG_ERROR("couldn't register '%s' commands",
driver_name);

View File

@ -367,8 +367,7 @@ COMMAND_HANDLER(handle_adapter_driver_command)
continue;
if (adapter_drivers[i]->commands) {
retval = register_commands(CMD_CTX, NULL,
adapter_drivers[i]->commands);
retval = register_commands(CMD_CTX, NULL, adapter_drivers[i]->commands);
if (retval != ERROR_OK)
return retval;
}

View File

@ -387,8 +387,7 @@ static const struct command_registration aice_transport_command_handlers[] = {
/* */
static int aice_transport_register_commands(struct command_context *cmd_ctx)
{
return register_commands(cmd_ctx, NULL,
aice_transport_command_handlers);
return register_commands(cmd_ctx, NULL, aice_transport_command_handlers);
}
/* */

View File

@ -196,15 +196,13 @@ static int hl_jtag_transport_select(struct command_context *cmd_ctx)
* That works with only C code ... no Tcl glue required.
*/
return register_commands(cmd_ctx, NULL,
hl_jtag_transport_command_handlers);
return register_commands(cmd_ctx, NULL, hl_jtag_transport_command_handlers);
}
static int hl_swd_transport_select(struct command_context *cmd_ctx)
{
LOG_DEBUG("hl_swd_transport_select");
return register_commands(cmd_ctx, NULL,
hl_swd_transport_command_handlers);
return register_commands(cmd_ctx, NULL, hl_swd_transport_command_handlers);
}
static struct transport hl_swd_transport = {

View File

@ -67,8 +67,7 @@ COMMAND_HANDLER(handle_pld_device_command)
/* register pld specific commands */
int retval;
if (pld_drivers[i]->commands) {
retval = register_commands(CMD_CTX, NULL,
pld_drivers[i]->commands);
retval = register_commands(CMD_CTX, NULL, pld_drivers[i]->commands);
if (retval != ERROR_OK) {
LOG_ERROR("couldn't register '%s' commands", CMD_ARGV[0]);
return ERROR_FAIL;

View File

@ -1416,8 +1416,7 @@ COMMAND_HANDLER(handle_etm_config_command)
for (i = 0; etm_capture_drivers[i]; i++) {
if (strcmp(CMD_ARGV[4], etm_capture_drivers[i]->name) == 0) {
int retval = register_commands(CMD_CTX, NULL,
etm_capture_drivers[i]->commands);
int retval = register_commands(CMD_CTX, NULL, etm_capture_drivers[i]->commands);
if (retval != ERROR_OK) {
free(etm_ctx);
return retval;