nvme: avoid memset for passthrough requests

nvme_clear_nvme_request() clears the nvme_command, which is unncessary
for passthrough requests as nvme_command is overwritten immediately.
Move clearing part from this helper to the caller, so that double memset
for passthrough requests is avoided.

Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by Kanchan Joshi and committed by Christoph Hellwig 51ad06cd 4c74d1f8

+3 -4
+3 -4
drivers/nvme/host/core.c
··· 589 589 590 590 static inline void nvme_clear_nvme_request(struct request *req) 591 591 { 592 - struct nvme_command *cmd = nvme_req(req)->cmd; 593 - 594 - memset(cmd, 0, sizeof(*cmd)); 595 592 nvme_req(req)->retries = 0; 596 593 nvme_req(req)->flags = 0; 597 594 req->rq_flags |= RQF_DONTPREP; ··· 900 903 struct nvme_command *cmd = nvme_req(req)->cmd; 901 904 blk_status_t ret = BLK_STS_OK; 902 905 903 - if (!(req->rq_flags & RQF_DONTPREP)) 906 + if (!(req->rq_flags & RQF_DONTPREP)) { 904 907 nvme_clear_nvme_request(req); 908 + memset(cmd, 0, sizeof(*cmd)); 909 + } 905 910 906 911 switch (req_op(req)) { 907 912 case REQ_OP_DRV_IN: