Skip to content

Commit da2968f

Browse files
committed
Merge tag 'pci-v5.9-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fix from Bjorn Helgaas: "Fix P2PDMA build issue (Christoph Hellwig)" * tag 'pci-v5.9-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI/P2PDMA: Fix build without DMA ops
2 parents d271b51 + 7c2308f commit da2968f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/pci/p2pdma.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,13 +556,14 @@ int pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients,
556556
return -1;
557557

558558
for (i = 0; i < num_clients; i++) {
559-
if (IS_ENABLED(CONFIG_DMA_VIRT_OPS) &&
560-
clients[i]->dma_ops == &dma_virt_ops) {
559+
#ifdef CONFIG_DMA_VIRT_OPS
560+
if (clients[i]->dma_ops == &dma_virt_ops) {
561561
if (verbose)
562562
dev_warn(clients[i],
563563
"cannot be used for peer-to-peer DMA because the driver makes use of dma_virt_ops\n");
564564
return -1;
565565
}
566+
#endif
566567

567568
pci_client = find_parent_pci_dev(clients[i]);
568569
if (!pci_client) {
@@ -842,9 +843,10 @@ static int __pci_p2pdma_map_sg(struct pci_p2pdma_pagemap *p2p_pgmap,
842843
* this should never happen because it will be prevented
843844
* by the check in pci_p2pdma_distance_many()
844845
*/
845-
if (WARN_ON_ONCE(IS_ENABLED(CONFIG_DMA_VIRT_OPS) &&
846-
dev->dma_ops == &dma_virt_ops))
846+
#ifdef CONFIG_DMA_VIRT_OPS
847+
if (WARN_ON_ONCE(dev->dma_ops == &dma_virt_ops))
847848
return 0;
849+
#endif
848850

849851
for_each_sg(sg, s, nents, i) {
850852
paddr = sg_phys(s);

0 commit comments

Comments
 (0)