]> git.gag.com Git - fw/openocd/blobdiff - src/target/arm_adi_v5.c
cmd: add missing usage vars
[fw/openocd] / src / target / arm_adi_v5.c
index 21dc54cd3d2ccd7ddf779690ba5b2f857fb08fe6..77d01a049d8c678900ffaf14779c65c26eb504ff 100644 (file)
@@ -1122,9 +1122,7 @@ int dap_syssec(struct adiv5_dap *dap)
 
                while (tap != NULL)
                {
-                       if (!tap->hasidcode)
-                               continue;
-                       if ( dap_syssec_filter_data[i].idcode == tap->idcode )
+                       if ( tap->hasidcode && (dap_syssec_filter_data[i].idcode == tap->idcode) )
                        {
                                LOG_DEBUG("DAP: mdmap_init for idcode: %08x",tap->idcode);
                                dap_syssec_filter_data[i].dap_init(dap);
@@ -1274,7 +1272,7 @@ int dap_get_debugbase(struct adiv5_dap *dap, int ap,
 
        /* AP address is in bits 31:24 of DP_SELECT */
        if (ap >= 256)
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
        ap_old = dap->ap_current;
        dap_ap_select(dap, ap);
@@ -1317,7 +1315,7 @@ int dap_lookup_cs_component(struct adiv5_dap *dap, int ap,
        int retval = ERROR_FAIL;
 
        if (ap >= 256)
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
        ap_old = dap->ap_current;
        dap_ap_select(dap, ap);
@@ -1354,7 +1352,7 @@ static int dap_info_command(struct command_context *cmd_ctx,
                struct adiv5_dap *dap, int ap)
 {
        int retval;
-       uint32_t dbgbase, apid;
+       uint32_t dbgbase = 0, apid = 0; /* Silence gcc by initializing */
        int romtable_present = 0;
        uint8_t mem_ap;
        uint32_t ap_old;
@@ -1801,7 +1799,7 @@ COMMAND_HANDLER(dap_baseaddr_command)
                COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                /* AP address is in bits 31:24 of DP_SELECT */
                if (apsel >= 256)
-                       return ERROR_INVALID_ARGUMENTS;
+                       return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1869,7 +1867,7 @@ COMMAND_HANDLER(dap_apsel_command)
                COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                /* AP address is in bits 31:24 of DP_SELECT */
                if (apsel >= 256)
-                       return ERROR_INVALID_ARGUMENTS;
+                       return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1908,7 +1906,7 @@ COMMAND_HANDLER(dap_apid_command)
                COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                /* AP address is in bits 31:24 of DP_SELECT */
                if (apsel >= 256)
-                       return ERROR_INVALID_ARGUMENTS;
+                       return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1977,6 +1975,7 @@ const struct command_registration dap_command_handlers[] = {
                .name = "dap",
                .mode = COMMAND_EXEC,
                .help = "DAP command group",
+               .usage = "",
                .chain = dap_commands,
        },
        COMMAND_REGISTRATION_DONE