diff options
author | Kanchan Joshi <joshi.k@samsung.com> | 2021-03-08 22:18:04 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-04-02 19:48:26 +0300 |
commit | 18479ddb7fd5fd0994bd10a95618bf866713a11b (patch) | |
tree | e711894833be7c8fa961d88ac5fcd5a9a46574cf /drivers/nvme | |
parent | 2bd643079ec1c44fac66838c27b993b78e8930a7 (diff) | |
download | linux-18479ddb7fd5fd0994bd10a95618bf866713a11b.tar.xz |
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>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/core.c | 3 |
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); |