nvme-pci: simplify nvme_dbbuf_dma_alloc
authorChristoph Hellwig <hch@lst.de>
Tue, 8 Nov 2022 09:56:49 +0000 (10:56 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 15 Nov 2022 09:56:20 +0000 (10:56 +0100)
commit65a54646420e1409760c2b9f0e1a5e5feca1364e
treee7498f8e3ec2d5a21432e01a24a93e0e497708f6
parenta6ee7f19ebfd158ffb3a6ebacf20ae43549bed05
nvme-pci: simplify nvme_dbbuf_dma_alloc

Move the OACS check and the error checking into nvme_dbbuf_dma_alloc so
that an upcoming second caller doesn't have to duplicate this boilerplate
code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
drivers/nvme/host/pci.c