Simplify jtag_execute_queue:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 8 Jun 2009 10:56:07 +0000 (10:56 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 8 Jun 2009 10:56:07 +0000 (10:56 +0000)
- Add static inline jtag_error_clear helper to return and clear jtag_error.
- Use new helper to shrink body of function to two lines.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2117 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/jtag.c
src/jtag/jtag.h

index 2caac53075d313f05f517f83d6bcfc9c874bb94b..1038aff635e03ccd0a872e25992f03213d97f686 100644 (file)
@@ -914,11 +914,8 @@ int jtag_get_flush_queue_count(void)
 
 int jtag_execute_queue(void)
 {
-       int retval;
        jtag_execute_queue_noclear();
-       retval=jtag_error;
-       jtag_error=ERROR_OK;
-       return retval;
+       return jtag_error_clear();
 }
 
 static int jtag_reset_callback(enum jtag_event event, void *priv)
index 01ef58cd87318bd3770582508a9a61a3cab24d87..90e8ae0b25932c77319a0916c3fe052acf57b031 100644 (file)
@@ -561,7 +561,16 @@ static __inline__ void jtag_set_error(int error)
        jtag_error=error;
 }
 
-
+/**
+ * Resets jtag_error to ERROR_OK, returning its previous value.
+ * @returns The previous value of @c jtag_error.
+ */
+static inline int jtag_error_clear(void)
+{
+       int temp = jtag_error;
+       jtag_error = ERROR_OK;
+       return temp;
+}
 
 /* can be implemented by hw+sw */
 extern int jtag_power_dropout(int* dropout);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)