diff options
author | Israel Rukshin <israelr@mellanox.com> | 2019-10-13 19:57:31 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-11-04 10:56:40 -0700 |
commit | 58a8df67e057e979e76f8dc881766da3f7137f99 (patch) | |
tree | cd51a6846725db606e2dca98f56cf18fadb3ac5b /drivers/nvme/target/loop.c | |
parent | bcde5f0fc7d318c98d4234b52bcc1a87fc2162d9 (diff) |
nvme: introduce nvme_is_aen_req function
This function improves code readability and reduces code duplication.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/target/loop.c')
-rw-r--r-- | drivers/nvme/target/loop.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 748a39fca771..bd1f81f97ab7 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -102,8 +102,8 @@ static void nvme_loop_queue_response(struct nvmet_req *req) * aborts. We don't even bother to allocate a struct request * for them but rather special case them here. */ - if (unlikely(nvme_loop_queue_idx(queue) == 0 && - cqe->command_id >= NVME_AQ_BLK_MQ_DEPTH)) { + if (unlikely(nvme_is_aen_req(nvme_loop_queue_idx(queue), + cqe->command_id))) { nvme_complete_async_event(&queue->ctrl->ctrl, cqe->status, &cqe->result); } else { |