mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
Kernel: Use AK:any_of in PCI::Device capability checks
This is equivalent to std::any_of as clang-tidy suggests.
This commit is contained in:
parent
5adf5f4dee
commit
19ba32651d
Notes:
sideshowbarker
2024-07-17 23:01:07 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/19ba32651db Pull-request: https://github.com/SerenityOS/serenity/pull/11188
@ -4,6 +4,7 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/AnyOf.h>
|
||||
#include <Kernel/Bus/PCI/API.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
|
||||
@ -17,19 +18,15 @@ Device::Device(Address address)
|
||||
|
||||
bool Device::is_msi_capable() const
|
||||
{
|
||||
for (const auto& capability : PCI::get_device_identifier(pci_address()).capabilities()) {
|
||||
if (capability.id().value() == PCI::Capabilities::ID::MSI)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return AK::any_of(
|
||||
PCI::get_device_identifier(pci_address()).capabilities(),
|
||||
[](auto const& capability) { return capability.id().value() == PCI::Capabilities::ID::MSI; });
|
||||
}
|
||||
bool Device::is_msix_capable() const
|
||||
{
|
||||
for (const auto& capability : PCI::get_device_identifier(pci_address()).capabilities()) {
|
||||
if (capability.id().value() == PCI::Capabilities::ID::MSIX)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return AK::any_of(
|
||||
PCI::get_device_identifier(pci_address()).capabilities(),
|
||||
[](auto const& capability) { return capability.id().value() == PCI::Capabilities::ID::MSIX; });
|
||||
}
|
||||
|
||||
void Device::enable_pin_based_interrupts() const
|
||||
|
Loading…
Reference in New Issue
Block a user