mirror of
https://github.com/qemu/qemu.git
synced 2024-12-13 05:33:34 +08:00
hw/block/nvme: fix missing endian conversion
Fix a missing cpu_to conversion by moving conversion to just before returning instead. Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20200706061303.246057-3-its@irrelevant.dk>
This commit is contained in:
parent
c26f217370
commit
a70174ef2e
@ -814,8 +814,8 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
|
||||
trace_pci_nvme_getfeat_vwcache(result ? "enabled" : "disabled");
|
||||
break;
|
||||
case NVME_NUMBER_OF_QUEUES:
|
||||
result = cpu_to_le32((n->params.max_ioqpairs - 1) |
|
||||
((n->params.max_ioqpairs - 1) << 16));
|
||||
result = (n->params.max_ioqpairs - 1) |
|
||||
((n->params.max_ioqpairs - 1) << 16);
|
||||
trace_pci_nvme_getfeat_numq(result);
|
||||
break;
|
||||
case NVME_TIMESTAMP:
|
||||
@ -825,7 +825,7 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
|
||||
return NVME_INVALID_FIELD | NVME_DNR;
|
||||
}
|
||||
|
||||
req->cqe.result = result;
|
||||
req->cqe.result = cpu_to_le32(result);
|
||||
return NVME_SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user