From 8290a05c2b3284e3820fc95a10c1cc189f1c186f Mon Sep 17 00:00:00 2001 From: zwelch Date: Mon, 8 Jun 2009 10:58:28 +0000 Subject: [PATCH] Simplify jtag_add_sleep: - Add todo for removing keep_alive: is this a layering violation? - Use jtag_set_error instead of accessing jtag_error directly. - Remove superfluous retval temporary variable and empty return. git-svn-id: svn://svn.berlios.de/openocd/trunk@2127 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/jtag/jtag.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index f53bd26cf..efc68f3d9 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -783,11 +783,9 @@ tap_state_t jtag_get_end_state(void) void jtag_add_sleep(u32 us) { - keep_alive(); /* we might be running on a very slow JTAG clk */ - int retval=interface_jtag_add_sleep(us); - if (retval!=ERROR_OK) - jtag_error=retval; - return; + /// @todo Here, keep_alive() appears to be a layering violation!!! + keep_alive(); + jtag_set_error(interface_jtag_add_sleep(us)); } int jtag_check_value_inner(u8 *captured, u8 *in_check_value, u8 *in_check_mask, int num_bits)