Factoring of jtag_examine_chain for maintainability:

- Reduce indent: invert logical test of expected_id count.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2082 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
zwelch 2009-06-07 05:22:53 +00:00
parent 15ae1ac678
commit 861f52ff16
1 changed files with 21 additions and 22 deletions

View File

@ -1077,7 +1077,12 @@ static int jtag_examine_chain(void)
} }
/* If none of the expected ids matched, log an error */ /* If none of the expected ids matched, log an error */
if (ii == tap->expected_ids_cnt) { if (ii != tap->expected_ids_cnt)
{
LOG_INFO("JTAG Tap/device matched");
tap = jtag_tap_next_enabled(tap);
continue;
}
LOG_ERROR("JTAG tap: %s got: 0x%08x (mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)", LOG_ERROR("JTAG tap: %s got: 0x%08x (mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)",
tap->dotted_name, tap->dotted_name,
idcode, idcode,
@ -1094,13 +1099,7 @@ static int jtag_examine_chain(void)
EXTRACT_PART( tap->expected_ids[ii] ), EXTRACT_PART( tap->expected_ids[ii] ),
EXTRACT_VER( tap->expected_ids[ii] ) ); EXTRACT_VER( tap->expected_ids[ii] ) );
} }
return ERROR_JTAG_INIT_FAILED; return ERROR_JTAG_INIT_FAILED;
} else {
LOG_INFO("JTAG Tap/device matched");
}
tap = jtag_tap_next_enabled(tap);
} }
/* see if number of discovered devices matches configuration */ /* see if number of discovered devices matches configuration */