I think the second comparison should check against TAP_SI (see LOG_ERROR-message)
void jtag_add_end_state(enum tap_state state)
{
cmd_queue_end_state = state;
if ((cmd_queue_end_state == TAP_SD)||(cmd_queue_end_state == TAP_SD))
{
LOG_ERROR("BUG: TAP_SD/SI can't be end state. Calling code should use a larger scan field");
}
}
Jürgen