aboutsummaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew.r.wilcox@intel.com>2013-05-06 08:22:18 -0400
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-05-08 09:55:05 -0400
commitab3ea5bf37e7189e843e19e500e7af50e802b5f6 (patch)
treeaf71b6bc25b4e51221d9fea8d3cd74d46ed66e83 /drivers/block
parent44af146a84fa4a8e136d824207dcd356958a112b (diff)
NVMe: Simplify Firmware Activate code slightly
Add definitions for the three Firmware Activate actions, and change the SCSI translation code to construct the command into a temporary variable instead of translating the endianness back-and-forth. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com> Reviewed-by: Vishal Verma <vishal.l.verma@linux.intel.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nvme-scsi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/nvme-scsi.c b/drivers/block/nvme-scsi.c
index 1c0710ca55d..fed54b03989 100644
--- a/drivers/block/nvme-scsi.c
+++ b/drivers/block/nvme-scsi.c
@@ -1577,10 +1577,8 @@ static int nvme_trans_send_fw_cmd(struct nvme_ns *ns, struct sg_io_hdr *hdr,
c.dlfw.numd = cpu_to_le32((tot_len/BYTES_TO_DWORDS) - 1);
c.dlfw.offset = cpu_to_le32(offset/BYTES_TO_DWORDS);
} else if (opcode == nvme_admin_activate_fw) {
- c.common.cdw10[0] = cpu_to_le32(buffer_id);
- /* AA=01b Replace & activate at reset */
- c.common.cdw10[0] = cpu_to_le32(le32_to_cpu(
- c.common.cdw10[0]) | 0x00000008);
+ u32 cdw10 = buffer_id | NVME_FWACT_REPL_ACTV;
+ c.common.cdw10[0] = cpu_to_le32(cdw10);
}
nvme_sc = nvme_submit_admin_cmd(dev, &c, NULL);