Commit e3f879bf authored by Sunad Bhandary's avatar Sunad Bhandary Committed by Jens Axboe

NVMe:Remove unreachable code in nvme_abort_req

Removing unreachable code from nvme_abort_req as nvme_submit_cmd has no
failure status to return.
Signed-off-by: default avatarSunad Bhandary <sunad.s@samsung.com>
Acked-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 81f03fed
...@@ -384,7 +384,8 @@ static void *nvme_finish_cmd(struct nvme_queue *nvmeq, int tag, ...@@ -384,7 +384,8 @@ static void *nvme_finish_cmd(struct nvme_queue *nvmeq, int tag,
* *
* Safe to use from interrupt context * Safe to use from interrupt context
*/ */
static int __nvme_submit_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd) static void __nvme_submit_cmd(struct nvme_queue *nvmeq,
struct nvme_command *cmd)
{ {
u16 tail = nvmeq->sq_tail; u16 tail = nvmeq->sq_tail;
...@@ -397,18 +398,14 @@ static int __nvme_submit_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd) ...@@ -397,18 +398,14 @@ static int __nvme_submit_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd)
tail = 0; tail = 0;
writel(tail, nvmeq->q_db); writel(tail, nvmeq->q_db);
nvmeq->sq_tail = tail; nvmeq->sq_tail = tail;
return 0;
} }
static int nvme_submit_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd) static void nvme_submit_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd)
{ {
unsigned long flags; unsigned long flags;
int ret;
spin_lock_irqsave(&nvmeq->q_lock, flags); spin_lock_irqsave(&nvmeq->q_lock, flags);
ret = __nvme_submit_cmd(nvmeq, cmd); __nvme_submit_cmd(nvmeq, cmd);
spin_unlock_irqrestore(&nvmeq->q_lock, flags); spin_unlock_irqrestore(&nvmeq->q_lock, flags);
return ret;
} }
static __le64 **iod_list(struct nvme_iod *iod) static __le64 **iod_list(struct nvme_iod *iod)
...@@ -1079,7 +1076,8 @@ static int nvme_submit_async_admin_req(struct nvme_dev *dev) ...@@ -1079,7 +1076,8 @@ static int nvme_submit_async_admin_req(struct nvme_dev *dev)
c.common.command_id = req->tag; c.common.command_id = req->tag;
blk_mq_free_request(req); blk_mq_free_request(req);
return __nvme_submit_cmd(nvmeq, &c); __nvme_submit_cmd(nvmeq, &c);
return 0;
} }
static int nvme_submit_admin_async_cmd(struct nvme_dev *dev, static int nvme_submit_admin_async_cmd(struct nvme_dev *dev,
...@@ -1102,7 +1100,8 @@ static int nvme_submit_admin_async_cmd(struct nvme_dev *dev, ...@@ -1102,7 +1100,8 @@ static int nvme_submit_admin_async_cmd(struct nvme_dev *dev,
cmd->common.command_id = req->tag; cmd->common.command_id = req->tag;
return nvme_submit_cmd(nvmeq, cmd); nvme_submit_cmd(nvmeq, cmd);
return 0;
} }
static int adapter_delete_queue(struct nvme_dev *dev, u8 opcode, u16 id) static int adapter_delete_queue(struct nvme_dev *dev, u8 opcode, u16 id)
...@@ -1314,12 +1313,7 @@ static void nvme_abort_req(struct request *req) ...@@ -1314,12 +1313,7 @@ static void nvme_abort_req(struct request *req)
dev_warn(nvmeq->q_dmadev, "Aborting I/O %d QID %d\n", req->tag, dev_warn(nvmeq->q_dmadev, "Aborting I/O %d QID %d\n", req->tag,
nvmeq->qid); nvmeq->qid);
if (nvme_submit_cmd(dev->queues[0], &cmd) < 0) { nvme_submit_cmd(dev->queues[0], &cmd);
dev_warn(nvmeq->q_dmadev,
"Could not abort I/O %d QID %d",
req->tag, nvmeq->qid);
blk_mq_free_request(abort_req);
}
} }
static void nvme_cancel_queue_ios(struct request *req, void *data, bool reserved) static void nvme_cancel_queue_ios(struct request *req, void *data, bool reserved)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment