diff options
author | Christoph Hellwig <hch@lst.de> | 2018-12-13 09:48:00 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-12-18 17:50:45 +0100 |
commit | 91a509f8b7a8a518723e1755b876b46c537baaef (patch) | |
tree | 5fb8f33cb3d4392a83be1531f814559bb2fa5553 /drivers/nvme | |
parent | nvme-pci: only set nr_maps to 2 if poll queues are supported (diff) | |
download | linux-91a509f8b7a8a518723e1755b876b46c537baaef.tar.xz linux-91a509f8b7a8a518723e1755b876b46c537baaef.zip |
nvme-pci: refactor nvme_poll_irqdisable to make sparse happy
By duplicating the nvme_process_cq in both branches we keep the
sparse lock context checking happy, so do it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/pci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index a3e0b9378e54..452b28130380 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1089,15 +1089,15 @@ static int nvme_poll_irqdisable(struct nvme_queue *nvmeq, unsigned int tag) * using the CQ lock. For normal interrupt driven threads we have * to disable the interrupt to avoid racing with it. */ - if (nvmeq->cq_vector == -1) + if (nvmeq->cq_vector == -1) { spin_lock(&nvmeq->cq_poll_lock); - else - disable_irq(pci_irq_vector(pdev, nvmeq->cq_vector)); - found = nvme_process_cq(nvmeq, &start, &end, tag); - if (nvmeq->cq_vector == -1) + found = nvme_process_cq(nvmeq, &start, &end, tag); spin_unlock(&nvmeq->cq_poll_lock); - else + } else { + disable_irq(pci_irq_vector(pdev, nvmeq->cq_vector)); + found = nvme_process_cq(nvmeq, &start, &end, tag); enable_irq(pci_irq_vector(pdev, nvmeq->cq_vector)); + } nvme_complete_cqes(nvmeq, start, end); return found; |