/* Factorization helper for the command state machine: Submit a CSW read and go to STAT state with counter (along  path).  */
static void ub_state_stat_counted(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
/* Factorization helper for the command state machine: Submit a CSW read and go to STAT state with counter (along  path).  */
static void ub_state_stat_counted(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
{
	if (++cmd->stat_count >= 4) {
		ub_state_sense(sc, cmd);
		return;
	}
	if (__ub_state_stat(sc, cmd) != 0)
		return;
	cmd->state = UB_CMDST_STAT;
}