From e3cd058cb46f246db3a7a17c7ce16fb3e987d3cd Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Wed, 10 Oct 2018 11:26:53 -0700 Subject: [PATCH] nvme: Don't alias sgl1 when building request This makes this particular function consistent with all of the other functions in this file, and I feel it is slightly more readable. Change-Id: I99ace5b9eb45b0f706ca85a64b155444f45c9815 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/428730 Reviewed-by: Seth Howell Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System --- lib/nvme/nvme_rdma.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index 08ca7ffc6..124ad7753 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -830,7 +830,6 @@ static int nvme_rdma_build_null_request(struct spdk_nvme_rdma_req *rdma_req) { struct nvme_request *req = rdma_req->req; - struct spdk_nvme_sgl_descriptor *nvme_sgl; req->cmd.psdt = SPDK_NVME_PSDT_SGL_MPTR_CONTIG; @@ -843,12 +842,11 @@ nvme_rdma_build_null_request(struct spdk_nvme_rdma_req *rdma_req) /* The RDMA SGL needs one element describing the NVMe command. */ rdma_req->send_wr.num_sge = 1; - nvme_sgl = &req->cmd.dptr.sgl1; - nvme_sgl->keyed.type = SPDK_NVME_SGL_TYPE_KEYED_DATA_BLOCK; - nvme_sgl->keyed.subtype = SPDK_NVME_SGL_SUBTYPE_ADDRESS; - nvme_sgl->keyed.length = 0; - nvme_sgl->keyed.key = 0; - nvme_sgl->address = 0; + req->cmd.dptr.sgl1.keyed.type = SPDK_NVME_SGL_TYPE_KEYED_DATA_BLOCK; + req->cmd.dptr.sgl1.keyed.subtype = SPDK_NVME_SGL_SUBTYPE_ADDRESS; + req->cmd.dptr.sgl1.keyed.length = 0; + req->cmd.dptr.sgl1.keyed.key = 0; + req->cmd.dptr.sgl1.address = 0; return 0; }