Re: [PATCH] mmc: block: Differentiate busy and non-TRAN state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	/*
> +	 * Cards will never return to TRAN after completing
> +	 * identification commands or MMC_SEND_STATUS if they are not selected.
> +	 */
> +	return !(cmd->opcode == MMC_GO_IDLE_STATE
> +			|| cmd->opcode == MMC_SEND_OP_COND
> +			|| cmd->opcode == MMC_ALL_SEND_CID
> +			|| cmd->opcode == MMC_SET_RELATIVE_ADDR
> +			|| cmd->opcode == MMC_SET_DSR
> +			|| cmd->opcode == MMC_SLEEP_AWAKE
> +			|| cmd->opcode == MMC_SELECT_CARD
> +			|| cmd->opcode == MMC_SEND_CSD
> +			|| cmd->opcode == MMC_SEND_CID
> +			|| cmd->opcode == MMC_SEND_STATUS
> +			|| cmd->opcode == MMC_GO_INACTIVE_STATE
> +			|| cmd->opcode == MMC_APP_CMD);

This is not the normal kernel style, which puts operators at the end
of the line.  And while a little more verbose I think a switch statement
would be a lot more readable here:

	switch (cmd->opcode) {
	case MMC_GO_IDLE_STATE:
	case MMC_SEND_OP_COND:
	case MMC_ALL_SEND_CID:
	case MMC_SET_RELATIVE_ADDR:
	case MMC_SET_DSR:
	case MMC_SLEEP_AWAKE:
	case MMC_SELECT_CARD:
	case MMC_SEND_CSD:
	case MMC_SEND_CID:
	case MMC_SEND_STATUS:
	case MMC_GO_INACTIVE_STATE:
	case MMC_APP_CMD:
		return false;
	default:
		return true;
	}



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux