summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKanchan Joshi <joshi.k@samsung.com>2021-03-09 00:48:04 +0530
committerChristoph Hellwig <hch@lst.de>2021-04-02 18:48:26 +0200
commit18479ddb7fd5fd0994bd10a95618bf866713a11b (patch)
treee711894833be7c8fa961d88ac5fcd5a9a46574cf
parent2bd643079ec1c44fac66838c27b993b78e8930a7 (diff)
nvme: reduce checks for zero command effects
For passthrough I/O commands, effects are usually to be zero. nvme_passthrough_end() does three checks in futility for this case. Bail out of function-call/checks. Signed-off-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/nvme/host/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index a5653892d773..3bbaf48833a8 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1137,7 +1137,8 @@ void nvme_execute_passthru_rq(struct request *rq)
effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode);
blk_execute_rq(disk, rq, 0);
- nvme_passthru_end(ctrl, effects);
+ if (effects) /* nothing to be done for zero cmd effects */
+ nvme_passthru_end(ctrl, effects);
}
EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);