From 8d843cc9cc0e989d3929f204f77223cd08730c7a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 24 Dec 2023 08:51:48 +0100 Subject: Merging upstream version 1.7.1. Signed-off-by: Daniel Baumann --- test/mi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'test/mi.c') diff --git a/test/mi.c b/test/mi.c index 7f8e005..a09c108 100644 --- a/test/mi.c +++ b/test/mi.c @@ -44,7 +44,8 @@ static int test_transport_submit(struct nvme_mi_ep *ep, /* start from a minimal response: zeroed data, nmp to match request */ memset(resp->hdr, 0, resp->hdr_len); - memset(resp->data, 0, resp->data_len); + if (resp->data_len) + memset(resp->data, 0, resp->data_len); resp->hdr->type = NVME_MI_MSGTYPE_NVME; resp->hdr->nmp = req->hdr->nmp | (NVME_MI_ROR_RSP << 7); @@ -1245,7 +1246,6 @@ static int test_admin_id_secondary_ctrl_list_cb(struct nvme_mi_ep *ep, void *data) { __u16 cns, ctrlid; - __u32 nsid; __u8 *hdr; hdr = (__u8 *)req->hdr; @@ -1256,9 +1256,6 @@ static int test_admin_id_secondary_ctrl_list_cb(struct nvme_mi_ep *ep, cns = hdr[45] << 8 | hdr[44]; assert(cns == NVME_IDENTIFY_CNS_SECONDARY_CTRL_LIST); - nsid = hdr[11] << 24 | hdr[10] << 16 | hdr[9] << 8 | hdr[8]; - assert(nsid == 0x01020304); - ctrlid = hdr[47] << 8 | hdr[46]; assert(ctrlid == 5); @@ -1280,8 +1277,7 @@ static void test_admin_id_secondary_ctrl_list(struct nvme_mi_ep *ep) ctrl = nvme_mi_init_ctrl(ep, 5); assert(ctrl); - rc = nvme_mi_admin_identify_secondary_ctrl_list(ctrl, 0x01020304, - 5, &list); + rc = nvme_mi_admin_identify_secondary_ctrl_list(ctrl, 5, &list); assert(!rc); } @@ -1651,7 +1647,10 @@ static int test_admin_format_nvm_cb(struct nvme_mi_ep *ep, assert(rq_hdr[4] == nvme_admin_format_nvm); - nsid = rq_hdr[11] << 24 | rq_hdr[10] << 16 | rq_hdr[9] << 8 | rq_hdr[8]; + nsid = (__u32)rq_hdr[11] << 24 + | rq_hdr[10] << 16 + | rq_hdr[9] << 8 + | rq_hdr[8]; assert(nsid == args->nsid); assert(((rq_hdr[44] >> 0) & 0xf) == args->lbaf); @@ -1726,7 +1725,7 @@ static int test_admin_sanitize_nvm_cb(struct nvme_mi_ep *ep, assert(((rq_hdr[45] >> 0) & 0x1) == args->oipbp); assert(((rq_hdr[45] >> 1) & 0x1) == args->nodas); - ovrpat = rq_hdr[51] << 24 | rq_hdr[50] << 16 | + ovrpat = (__u32)rq_hdr[51] << 24 | rq_hdr[50] << 16 | rq_hdr[49] << 8 | rq_hdr[48]; assert(ovrpat == args->ovrpat); -- cgit v1.2.3