Skip to content

Commit 9f0f8fd

Browse files
author
Kelvin Cao
committed
Decode rsp length in 'switchtec_device_manage' in bytes
1 parent f2516cf commit 9f0f8fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

switchtec-nvme-device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int pax_nvme_submit_admin_passthru(int fd, struct nvme_passthru_cmd *cmd)
7676

7777
memcpy(req.nvme_data, (void *)cmd->addr, data_len);
7878

79-
req.hdr.expected_rsp_len = (sizeof(rsp.nvme_cqe) + sizeof(rsp.nvme_data))/4;
79+
req.hdr.expected_rsp_len = (sizeof(rsp.nvme_cqe) + sizeof(rsp.nvme_data));
8080

8181
ret = switchtec_device_manage(pax->dev,
8282
(struct switchtec_device_manage_req *)&req,
@@ -93,7 +93,7 @@ int pax_nvme_submit_admin_passthru(int fd, struct nvme_passthru_cmd *cmd)
9393
if (!write) {
9494
memcpy((uint64_t *)cmd->addr,
9595
rsp.nvme_data,
96-
(rsp.hdr.rsp_len - 4) * 4);
96+
rsp.hdr.rsp_len - 4 * 4);
9797
}
9898
}
9999

0 commit comments

Comments
 (0)