Skip to content

Commit 7e9f5a2

Browse files
authored
Merge pull request #529 from CodeConstruct/pr/be
mi: endian fixes
2 parents d516933 + ac65735 commit 7e9f5a2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/nvme/mi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ int nvme_mi_scan_ep(nvme_mi_ep_t ep, bool force_rescan)
334334
struct nvme_mi_ctrl *ctrl;
335335
__u16 id;
336336

337-
id = le32_to_cpu(list.identifier[i]);
337+
id = le16_to_cpu(list.identifier[i]);
338338

339339
ctrl = nvme_mi_init_ctrl(ep, id);
340340
if (!ctrl)
@@ -1280,7 +1280,7 @@ static int nvme_mi_read_data(nvme_mi_ep_t ep, __u32 cdw0,
12801280
req_hdr.hdr.nmp = (NVME_MI_ROR_REQ << 7) |
12811281
(NVME_MI_MT_MI << 3); /* we always use command slot 0 */
12821282
req_hdr.opcode = nvme_mi_mi_opcode_mi_data_read;
1283-
req_hdr.cdw0 = cdw0;
1283+
req_hdr.cdw0 = cpu_to_le32(cdw0);
12841284

12851285
memset(&req, 0, sizeof(req));
12861286
req.hdr = &req_hdr.hdr;

test/mi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ static void test_admin_ns_mgmt_create(struct nvme_mi_ep *ep)
13531353
assert(!rc);
13541354
assert(ns == 0x01020304);
13551355

1356-
nsid.nsze = 42;
1356+
nsid.nsze = cpu_to_le64(42);
13571357
rc = nvme_mi_admin_ns_mgmt_create(ctrl, &nsid, 0, &ns);
13581358
assert(rc);
13591359
}

0 commit comments

Comments
 (0)