diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-09 02:23:44 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-09 02:23:44 +0000 |
commit | 0c3e5b50694fcdebc3edccc373fc08adb94d0bb8 (patch) | |
tree | 1a0cb05bae9f59b75d9b66f1cee65cc781eaad96 /src | |
parent | 009034f56cb87065453363ad674bd94f98c3ed50 (diff) | |
download | openocd_libswd-0c3e5b50694fcdebc3edccc373fc08adb94d0bb8.tar.gz openocd_libswd-0c3e5b50694fcdebc3edccc373fc08adb94d0bb8.tar.bz2 openocd_libswd-0c3e5b50694fcdebc3edccc373fc08adb94d0bb8.tar.xz openocd_libswd-0c3e5b50694fcdebc3edccc373fc08adb94d0bb8.zip |
Cleanup jtag_tap_by_abs_position:
- Remove unused orig_n local variable.
- Merge variable declaration with first use.
- Update code to use current style guidelines.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2143 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/jtag.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 336b74f9..05cfd948 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -311,18 +311,13 @@ jtag_tap_t *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *o) } /* returns a pointer to the n-th device in the scan chain */ -jtag_tap_t * jtag_tap_by_abs_position( int n ) +jtag_tap_t *jtag_tap_by_abs_position(int n) { - int orig_n; - jtag_tap_t *t; - - orig_n = n; - t = jtag_all_taps(); + jtag_tap_t *t = jtag_all_taps(); - while( t && (n > 0)) { - n--; + while (t && n-- > 0) t = t->next_tap; - } + return t; } |