diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-08-11 11:00:02 +0200 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-08-11 11:01:14 +0200 |
commit | 676f48d77db83c687740955aed6783ea6d326853 (patch) | |
tree | bd6d2f8c8d7b6862e77fa2ec9785699a511f13b4 /src | |
parent | f941192723f7d71ae4a9a8f011dad5909f156da3 (diff) | |
download | openocd_libswd-676f48d77db83c687740955aed6783ea6d326853.tar.gz openocd_libswd-676f48d77db83c687740955aed6783ea6d326853.tar.bz2 openocd_libswd-676f48d77db83c687740955aed6783ea6d326853.tar.xz openocd_libswd-676f48d77db83c687740955aed6783ea6d326853.zip |
debug: use assert's when approperiate
error was returned instead of using assert.
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/arm_jtag.h | 3 | ||||
-rw-r--r-- | src/target/xscale.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/target/arm_jtag.h b/src/target/arm_jtag.h index 37c228f8..f5812781 100644 --- a/src/target/arm_jtag.h +++ b/src/target/arm_jtag.h @@ -45,8 +45,7 @@ static inline int arm_jtag_set_instr(struct arm_jtag *jtag_info, /* inline most common code path */ struct jtag_tap *tap; tap = jtag_info->tap; - if (tap == NULL) - return ERROR_FAIL; + assert (tap != NULL); if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr) { diff --git a/src/target/xscale.c b/src/target/xscale.c index c0080b2b..44358bc3 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -160,8 +160,7 @@ static int xscale_verify_pointer(struct command_context *cmd_ctx, static int xscale_jtag_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state) { - if (tap == NULL) - return ERROR_FAIL; + assert (tap != NULL); if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr) { |