From: Leon Romanovsky <leonro@xxxxxxxxxx> Instead of keeping dedicated "bool aborted" variable, let's reuse newly introduced flags variable and save space. Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx> --- drivers/nvme/host/pci.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index eb60a486331c..f69f1eb4308e 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -219,6 +219,7 @@ struct nvme_queue { enum { IOD_LARGE_DESCRIPTORS = 1, /* uses the full page sized descriptor pool */ IOD_SINGLE_SEGMENT = 2, /* single segment dma mapping */ + IOD_ABORTED = 3, /* abort timed out commands */ }; /* @@ -227,7 +228,6 @@ enum { struct nvme_iod { struct nvme_request req; struct nvme_command cmd; - bool aborted; u8 nr_descriptors; /* # of PRP/SGL descriptors */ unsigned int flags; unsigned int total_len; /* length of the entire transfer */ @@ -1029,7 +1029,6 @@ static blk_status_t nvme_prep_rq(struct nvme_dev *dev, struct request *req) struct nvme_iod *iod = blk_mq_rq_to_pdu(req); blk_status_t ret; - iod->aborted = false; iod->nr_descriptors = 0; iod->flags = 0; iod->total_len = 0; @@ -1578,7 +1577,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req) * returned to the driver, or if this is the admin queue. */ opcode = nvme_req(req)->cmd->common.opcode; - if (!nvmeq->qid || iod->aborted) { + if (!nvmeq->qid || (iod->flags & IOD_ABORTED)) { dev_warn(dev->ctrl.device, "I/O tag %d (%04x) opcode %#x (%s) QID %d timeout, reset controller\n", req->tag, nvme_cid(req), opcode, @@ -1591,7 +1590,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req) atomic_inc(&dev->ctrl.abort_limit); return BLK_EH_RESET_TIMER; } - iod->aborted = true; + iod->flags |= IOD_ABORTED; cmd.abort.opcode = nvme_admin_abort_cmd; cmd.abort.cid = nvme_cid(req); -- 2.49.0