Skip to content

Commit

Permalink
nvmet: use nvme status value directly
Browse files Browse the repository at this point in the history
There is no point in keeping the status variable that is used only once
in the function nvmet_async_events_failall().

Remove the variable and use the value directly.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
ChaitanayaKulkarni authored and Christoph Hellwig committed Jun 17, 2021
1 parent 245067e commit 8bb6cb9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/nvme/target/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,13 @@ static u32 nvmet_async_event_result(struct nvmet_async_event *aen)

static void nvmet_async_events_failall(struct nvmet_ctrl *ctrl)
{
u16 status = NVME_SC_INTERNAL | NVME_SC_DNR;
struct nvmet_req *req;

mutex_lock(&ctrl->lock);
while (ctrl->nr_async_event_cmds) {
req = ctrl->async_event_cmds[--ctrl->nr_async_event_cmds];
mutex_unlock(&ctrl->lock);
nvmet_req_complete(req, status);
nvmet_req_complete(req, NVME_SC_INTERNAL | NVME_SC_DNR);
mutex_lock(&ctrl->lock);
}
mutex_unlock(&ctrl->lock);
Expand Down

0 comments on commit 8bb6cb9

Please sign in to comment.