From: Kanchan Joshi Date: Mon, 8 Mar 2021 19:18:04 +0000 (+0530) Subject: nvme: reduce checks for zero command effects X-Git-Tag: v5.13-rc1~116^2~65^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18479ddb7fd5fd0994bd10a95618bf866713a11b;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index a5653892d7739..3bbaf48833a8e 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);