summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/Bus/PCI/Definitions.h2
-rw-r--r--Kernel/Bus/PCI/DeviceController.cpp4
-rw-r--r--Kernel/Graphics/VirtIOGPU/VirtIOGPU.h3
3 files changed, 4 insertions, 5 deletions
diff --git a/Kernel/Bus/PCI/Definitions.h b/Kernel/Bus/PCI/Definitions.h
index 08edcf6cc9..f2ec09dd0c 100644
--- a/Kernel/Bus/PCI/Definitions.h
+++ b/Kernel/Bus/PCI/Definitions.h
@@ -198,7 +198,7 @@ public:
, m_capabilities(capabilities)
{
if constexpr (PCI_DEBUG) {
- for (auto capability : capabilities)
+ for (const auto& capability : capabilities)
dbgln("{} has capability {}", address, capability.id());
}
}
diff --git a/Kernel/Bus/PCI/DeviceController.cpp b/Kernel/Bus/PCI/DeviceController.cpp
index 7dd396dc0b..8e0705b1e5 100644
--- a/Kernel/Bus/PCI/DeviceController.cpp
+++ b/Kernel/Bus/PCI/DeviceController.cpp
@@ -16,7 +16,7 @@ DeviceController::DeviceController(Address address)
bool DeviceController::is_msi_capable() const
{
- for (auto capability : PCI::get_physical_id(pci_address()).capabilities()) {
+ for (const auto& capability : PCI::get_physical_id(pci_address()).capabilities()) {
if (capability.id() == PCI_CAPABILITY_MSI)
return true;
}
@@ -24,7 +24,7 @@ bool DeviceController::is_msi_capable() const
}
bool DeviceController::is_msix_capable() const
{
- for (auto capability : PCI::get_physical_id(pci_address()).capabilities()) {
+ for (const auto& capability : PCI::get_physical_id(pci_address()).capabilities()) {
if (capability.id() == PCI_CAPABILITY_MSIX)
return true;
}
diff --git a/Kernel/Graphics/VirtIOGPU/VirtIOGPU.h b/Kernel/Graphics/VirtIOGPU/VirtIOGPU.h
index e39225f0a2..71c6f914ca 100644
--- a/Kernel/Graphics/VirtIOGPU/VirtIOGPU.h
+++ b/Kernel/Graphics/VirtIOGPU/VirtIOGPU.h
@@ -185,8 +185,7 @@ public:
template<typename F>
IterationDecision for_each_framebuffer(F f)
{
- for (size_t i = 0; i < VIRTIO_GPU_MAX_SCANOUTS; i++) {
- auto& scanout = m_scanouts[i];
+ for (auto& scanout : m_scanouts) {
if (!scanout.framebuffer)
continue;
IterationDecision decision = f(*scanout.framebuffer, *scanout.console);