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>
This commit is contained in:
Kanchan Joshi 2021-03-09 00:48:04 +05:30 committed by Christoph Hellwig
parent 2bd643079e
commit 18479ddb7f
1 changed files with 2 additions and 1 deletions

View File

@ -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);