From 1bc2c5c110148270dd9928e45e2bd1c94db849f3 Mon Sep 17 00:00:00 2001 From: Pankaj Raghav Date: Mon, 8 May 2023 21:26:55 +0200 Subject: [PATCH] Kernel: Use PCIDeviceIdentifier is_msi_capable() to retrieve MSI status Instead of iterating through the capabilities, use the is_msi_capable() API from the PCIDeviceIdentifier class that belongs to the device. --- Kernel/Bus/PCI/Device.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Kernel/Bus/PCI/Device.cpp b/Kernel/Bus/PCI/Device.cpp index 09e6bc06a6..7fe2503eb8 100644 --- a/Kernel/Bus/PCI/Device.cpp +++ b/Kernel/Bus/PCI/Device.cpp @@ -23,9 +23,7 @@ Device::Device(DeviceIdentifier const& pci_identifier) bool Device::is_msi_capable() const { - return AK::any_of( - m_pci_identifier->capabilities(), - [](auto const& capability) { return capability.id().value() == PCI::Capabilities::ID::MSI; }); + return m_pci_identifier->is_msi_capable(); } bool Device::is_msix_capable() const {