PCI: epf-test: Simplify DMA support checks
authorDamien Le Moal <dlemoal@kernel.org>
Sat, 15 Apr 2023 02:35:37 +0000 (11:35 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 23 Jun 2023 20:03:02 +0000 (15:03 -0500)
commit2566cbea69ab8dad4996ab4b4840fd952e62e5b4
treeeeaa576aa9a3e5752ade33760bbeb5cb299a1336
parent2eec4bec3574ce1a8b0fcf568cebc82c1ad7ec80
PCI: epf-test: Simplify DMA support checks

There is no need to have each read, write and copy test functions check
for the FLAG_USE_DMA flag against the DMA support status indicated by
epf_test->dma_supported. Move this test to the command handler function
pci_epf_test_cmd_handler() to check once for all cases.

Link: https://lore.kernel.org/r/20230415023542.77601-13-dlemoal@kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
drivers/pci/endpoint/functions/pci-epf-test.c