summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-10-26 23:06:22 -0700
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-10-26 23:06:22 -0700
commit0b476c9f4c0235f52f1a6c522f4835b5ca7e05c5 (patch)
tree0b2ed02ef35cb7d645e7a1facc72bc6461d0cbf9 /src
parent4a26390eec5b969c07684ab5d4b7e957011d71bd (diff)
downloadopenocd+libswd-0b476c9f4c0235f52f1a6c522f4835b5ca7e05c5.tar.gz
openocd+libswd-0b476c9f4c0235f52f1a6c522f4835b5ca7e05c5.tar.bz2
openocd+libswd-0b476c9f4c0235f52f1a6c522f4835b5ca7e05c5.tar.xz
openocd+libswd-0b476c9f4c0235f52f1a6c522f4835b5ca7e05c5.zip
JTAG: "jtag newtap ..." cleanup
Get rid of needless variable, improve and shrink diagnostic. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src')
-rw-r--r--src/jtag/tcl.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index 6a6e3ae0..5056a5c5 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -197,7 +197,6 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
jim_wide w;
int x;
int e;
- int reqbits;
Jim_Nvp *n;
char *cp;
const Jim_Nvp opts[] = {
@@ -252,9 +251,6 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
pTap->ir_capture_mask = 0x03;
pTap->ir_capture_value = 0x01;
- /* clear flags for "required options" them as we find them */
- reqbits = 1;
-
while (goi->argc) {
e = Jim_GetOpt_Nvp(goi, opts, &n);
if (e != JIM_OK) {
@@ -317,7 +313,6 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
pTap->dotted_name,
(int) w);
pTap->ir_length = w;
- reqbits = 0;
break;
case NTAP_OPT_IRMASK:
if (is_bad_irval(pTap->ir_length, w)) {
@@ -355,14 +350,14 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
pTap->enabled = !pTap->disabled_after_reset;
/* Did all the required option bits get cleared? */
- if (0 == reqbits)
+ if (pTap->ir_length != 0)
{
jtag_tap_init(pTap);
return ERROR_OK;
}
Jim_SetResult_sprintf(goi->interp,
- "newtap: %s missing required parameters",
+ "newtap: %s missing IR length",
pTap->dotted_name);
jtag_tap_free(pTap);
return JIM_ERR;