diff options
author | Niklas Cassel <cassel@kernel.org> | 2025-03-10 12:10:20 +0100 |
---|---|---|
committer | Krzysztof Wilczyński <kwilczynski@kernel.org> | 2025-03-14 16:12:04 +0000 |
commit | 24a42582b00810970decb051ce3e25d2c661dd92 (patch) | |
tree | 82ced06ba5da48bcac3187fcf36ad2906d722d75 | |
parent | 64a7704ae16f5836ba74152553ae2a7338229a9d (diff) |
selftests: pci_endpoint: Use IRQ_TYPE_* defines from UAPI header
In order to improve readability, use the IRQ_TYPE_* defines from the UAPI
header rather than using raw values.
No functional change.
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Link: https://lore.kernel.org/r/20250310111016.859445-12-cassel@kernel.org
-rw-r--r-- | tools/testing/selftests/pci_endpoint/pci_endpoint_test.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c index d05e107d06984..fdf4bc6aa9d2a 100644 --- a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c +++ b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c @@ -99,11 +99,11 @@ TEST_F(pci_ep_basic, LEGACY_IRQ_TEST) { int ret; - pci_ep_ioctl(PCITEST_SET_IRQTYPE, 0); + pci_ep_ioctl(PCITEST_SET_IRQTYPE, PCITEST_IRQ_TYPE_INTX); ASSERT_EQ(0, ret) TH_LOG("Can't set Legacy IRQ type"); pci_ep_ioctl(PCITEST_GET_IRQTYPE, 0); - ASSERT_EQ(0, ret) TH_LOG("Can't get Legacy IRQ type"); + ASSERT_EQ(PCITEST_IRQ_TYPE_INTX, ret) TH_LOG("Can't get Legacy IRQ type"); pci_ep_ioctl(PCITEST_LEGACY_IRQ, 0); EXPECT_FALSE(ret) TH_LOG("Test failed for Legacy IRQ"); @@ -113,11 +113,11 @@ TEST_F(pci_ep_basic, MSI_TEST) { int ret, i; - pci_ep_ioctl(PCITEST_SET_IRQTYPE, 1); + pci_ep_ioctl(PCITEST_SET_IRQTYPE, PCITEST_IRQ_TYPE_MSI); ASSERT_EQ(0, ret) TH_LOG("Can't set MSI IRQ type"); pci_ep_ioctl(PCITEST_GET_IRQTYPE, 0); - ASSERT_EQ(1, ret) TH_LOG("Can't get MSI IRQ type"); + ASSERT_EQ(PCITEST_IRQ_TYPE_MSI, ret) TH_LOG("Can't get MSI IRQ type"); for (i = 1; i <= 32; i++) { pci_ep_ioctl(PCITEST_MSI, i); @@ -129,11 +129,11 @@ TEST_F(pci_ep_basic, MSIX_TEST) { int ret, i; - pci_ep_ioctl(PCITEST_SET_IRQTYPE, 2); + pci_ep_ioctl(PCITEST_SET_IRQTYPE, PCITEST_IRQ_TYPE_MSIX); ASSERT_EQ(0, ret) TH_LOG("Can't set MSI-X IRQ type"); pci_ep_ioctl(PCITEST_GET_IRQTYPE, 0); - ASSERT_EQ(2, ret) TH_LOG("Can't get MSI-X IRQ type"); + ASSERT_EQ(PCITEST_IRQ_TYPE_MSIX, ret) TH_LOG("Can't get MSI-X IRQ type"); for (i = 1; i <= 2048; i++) { pci_ep_ioctl(PCITEST_MSIX, i); @@ -181,7 +181,7 @@ TEST_F(pci_ep_data_transfer, READ_TEST) if (variant->use_dma) param.flags = PCITEST_FLAGS_USE_DMA; - pci_ep_ioctl(PCITEST_SET_IRQTYPE, 1); + pci_ep_ioctl(PCITEST_SET_IRQTYPE, PCITEST_IRQ_TYPE_MSI); ASSERT_EQ(0, ret) TH_LOG("Can't set MSI IRQ type"); for (i = 0; i < ARRAY_SIZE(test_size); i++) { @@ -200,7 +200,7 @@ TEST_F(pci_ep_data_transfer, WRITE_TEST) if (variant->use_dma) param.flags = PCITEST_FLAGS_USE_DMA; - pci_ep_ioctl(PCITEST_SET_IRQTYPE, 1); + pci_ep_ioctl(PCITEST_SET_IRQTYPE, PCITEST_IRQ_TYPE_MSI); ASSERT_EQ(0, ret) TH_LOG("Can't set MSI IRQ type"); for (i = 0; i < ARRAY_SIZE(test_size); i++) { @@ -219,7 +219,7 @@ TEST_F(pci_ep_data_transfer, COPY_TEST) if (variant->use_dma) param.flags = PCITEST_FLAGS_USE_DMA; - pci_ep_ioctl(PCITEST_SET_IRQTYPE, 1); + pci_ep_ioctl(PCITEST_SET_IRQTYPE, PCITEST_IRQ_TYPE_MSI); ASSERT_EQ(0, ret) TH_LOG("Can't set MSI IRQ type"); for (i = 0; i < ARRAY_SIZE(test_size); i++) { |