/* Factorization helper for the command state machine: Finish the command.  */
static void ub_state_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd, int rc)
/* Factorization helper for the command state machine: Finish the command.  */
static void ub_state_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd, int rc)
{
	cmd->error = rc;
	cmd->state = UB_CMDST_DONE;
	ub_cmdq_pop(sc);
	(*cmd->done)(sc, cmd);
}