nvme: simplify SGL length calculation
Drop the "data_transfered" variable and just update length, since length was not used otherwise after this point in the loop. Change-Id: Icd2991e4e85de7e8c951ba14c441434e871ea4ef Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
3cec6c846b
commit
2c4476560b
@ -658,7 +658,7 @@ _nvme_qpair_build_hw_sgl_request(struct spdk_nvme_qpair *qpair, struct nvme_requ
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
uint64_t phys_addr;
|
uint64_t phys_addr;
|
||||||
uint32_t data_transfered, remaining_transfer_len, length;
|
uint32_t remaining_transfer_len, length;
|
||||||
struct spdk_nvme_sgl_descriptor *sgl;
|
struct spdk_nvme_sgl_descriptor *sgl;
|
||||||
uint32_t nseg = 0;
|
uint32_t nseg = 0;
|
||||||
|
|
||||||
@ -684,11 +684,11 @@ _nvme_qpair_build_hw_sgl_request(struct spdk_nvme_qpair *qpair, struct nvme_requ
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
data_transfered = nvme_min(remaining_transfer_len, length);
|
length = nvme_min(remaining_transfer_len, length);
|
||||||
remaining_transfer_len -= data_transfered;
|
remaining_transfer_len -= length;
|
||||||
|
|
||||||
sgl->type = SPDK_NVME_SGL_TYPE_DATA_BLOCK;
|
sgl->type = SPDK_NVME_SGL_TYPE_DATA_BLOCK;
|
||||||
sgl->length = data_transfered;
|
sgl->length = length;
|
||||||
sgl->address = phys_addr;
|
sgl->address = phys_addr;
|
||||||
sgl->type_specific = 0;
|
sgl->type_specific = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user