RE: [PATCH v2 3/8] nvme: add nvme opcodes, structures and helper functions

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

 



> -----Original Message-----
> From: Ankit Kumar [mailto:ankit.kumar@xxxxxxxxxxx]

> +
> +	if (io_u->ddir == DDIR_READ)
> +		cmd->opcode = nvme_cmd_read;
> +	if (io_u->ddir == DDIR_WRITE)
> +		cmd->opcode = nvme_cmd_write;

Consider changing this to a switch statement and adding a default: case
in case someone tries to send an unsupported command.

Since this is in the  fast path a switch statement would also reduce the number
of times ddir is checked.




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

  Powered by Linux