]> git.sur5r.net Git - openocd/blobdiff - src/target/arm926ejs.c
Michael Bruck: fixed warnings
[openocd] / src / target / arm926ejs.c
index 75d43fd8a798991df45308ee2ff5e955a98f5a8c..ff73e1a12ac6f5d0f953d9c9f9a9439ebe7f2375 100644 (file)
@@ -173,7 +173,7 @@ int arm926ejs_cp15_read(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u3
        fields[3].in_handler = NULL;
        fields[3].in_handler_priv = NULL;
        
-       jtag_add_dr_scan(4, fields, -1, NULL);
+       jtag_add_dr_scan(4, fields, -1);
 
        fields[0].in_handler_priv = value;
        fields[0].in_handler = arm_jtag_buf_to_u32;
@@ -183,7 +183,7 @@ int arm926ejs_cp15_read(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u3
                /* rescan with NOP, to wait for the access to complete */
                access = 0;
                nr_w_buf = 0;
-               jtag_add_dr_scan(4, fields, -1, NULL);
+               jtag_add_dr_scan(4, fields, -1);
                jtag_execute_queue();
        } while (buf_get_u32(&access, 0, 1) != 1);
 
@@ -255,14 +255,14 @@ int arm926ejs_cp15_write(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u
        fields[3].in_handler = NULL;
        fields[3].in_handler_priv = NULL;
        
-       jtag_add_dr_scan(4, fields, -1, NULL);
+       jtag_add_dr_scan(4, fields, -1);
 
        do
        {
                /* rescan with NOP, to wait for the access to complete */
                access = 0;
                nr_w_buf = 0;
-               jtag_add_dr_scan(4, fields, -1, NULL);
+               jtag_add_dr_scan(4, fields, -1);
                jtag_execute_queue();
        } while (buf_get_u32(&access, 0, 1) != 1);
 
@@ -337,9 +337,11 @@ int arm926ejs_examine_debug_reason(target_t *target)
                default:
                        ERROR("BUG: unknown debug reason: 0x%x", debug_reason);
                        target->debug_reason = DBG_REASON_DBGRQ;
+                       retval = ERROR_TARGET_FAILURE;
+                       break;
        }
        
-       return ERROR_OK;
+       return retval;
 }
 
 u32 arm926ejs_get_ttb(target_t *target)
@@ -702,6 +704,7 @@ int arm926ejs_target_command(struct command_context_s *cmd_ctx, char *cmd, char
        int chain_pos;
        char *variant = NULL;
        arm926ejs_common_t *arm926ejs = malloc(sizeof(arm926ejs_common_t));
+       memset(arm926ejs, 0, sizeof(*arm926ejs));
        
        if (argc < 4)
        {