diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-04-01 20:58:27 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-04-01 21:24:45 +0100 |
commit | 086969277e74d8ba065bf8145d3aeb0dec0bfee5 (patch) | |
tree | 02b3699a66735ef806d9b46353491f18f8e4e7b4 /Kernel/Bus | |
parent | 0376c127f6e98e03607700d0b3f5154b7014b2f8 (diff) | |
download | serenity-086969277e74d8ba065bf8145d3aeb0dec0bfee5.zip |
Everywhere: Run clang-format
Diffstat (limited to 'Kernel/Bus')
-rw-r--r-- | Kernel/Bus/PCI/Controller/MemoryBackedHostBridge.cpp | 4 | ||||
-rw-r--r-- | Kernel/Bus/PCI/Definitions.h | 22 | ||||
-rw-r--r-- | Kernel/Bus/PCI/SysFSPCI.cpp | 8 | ||||
-rw-r--r-- | Kernel/Bus/PCI/SysFSPCI.h | 10 | ||||
-rw-r--r-- | Kernel/Bus/USB/UHCI/UHCIController.cpp | 2 | ||||
-rw-r--r-- | Kernel/Bus/USB/UHCI/UHCIController.h | 2 | ||||
-rw-r--r-- | Kernel/Bus/USB/UHCI/UHCIDescriptorTypes.h | 8 | ||||
-rw-r--r-- | Kernel/Bus/USB/USBDevice.h | 2 | ||||
-rw-r--r-- | Kernel/Bus/USB/USBEndpoint.h | 2 | ||||
-rw-r--r-- | Kernel/Bus/USB/USBTransfer.cpp | 2 | ||||
-rw-r--r-- | Kernel/Bus/USB/USBTransfer.h | 6 | ||||
-rw-r--r-- | Kernel/Bus/VirtIO/ConsolePort.cpp | 6 | ||||
-rw-r--r-- | Kernel/Bus/VirtIO/ConsolePort.h | 6 | ||||
-rw-r--r-- | Kernel/Bus/VirtIO/Device.cpp | 16 | ||||
-rw-r--r-- | Kernel/Bus/VirtIO/Device.h | 26 | ||||
-rw-r--r-- | Kernel/Bus/VirtIO/Queue.cpp | 6 | ||||
-rw-r--r-- | Kernel/Bus/VirtIO/Queue.h | 2 |
17 files changed, 65 insertions, 65 deletions
diff --git a/Kernel/Bus/PCI/Controller/MemoryBackedHostBridge.cpp b/Kernel/Bus/PCI/Controller/MemoryBackedHostBridge.cpp index febee0a068..4cfb166381 100644 --- a/Kernel/Bus/PCI/Controller/MemoryBackedHostBridge.cpp +++ b/Kernel/Bus/PCI/Controller/MemoryBackedHostBridge.cpp @@ -26,7 +26,7 @@ u8 MemoryBackedHostBridge::read8_field(BusNumber bus, DeviceNumber device, Funct { VERIFY(Access::the().access_lock().is_locked()); VERIFY(field <= 0xfff); - return *((volatile u8*)(get_device_configuration_memory_mapped_space(bus, device, function).get() + (field & 0xfff))); + return *((u8 volatile*)(get_device_configuration_memory_mapped_space(bus, device, function).get() + (field & 0xfff))); } u16 MemoryBackedHostBridge::read16_field(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field) { @@ -48,7 +48,7 @@ void MemoryBackedHostBridge::write8_field(BusNumber bus, DeviceNumber device, Fu { VERIFY(Access::the().access_lock().is_locked()); VERIFY(field <= 0xfff); - *((volatile u8*)(get_device_configuration_memory_mapped_space(bus, device, function).get() + (field & 0xfff))) = value; + *((u8 volatile*)(get_device_configuration_memory_mapped_space(bus, device, function).get() + (field & 0xfff))) = value; } void MemoryBackedHostBridge::write16_field(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field, u16 value) { diff --git a/Kernel/Bus/PCI/Definitions.h b/Kernel/Bus/PCI/Definitions.h index c4a9d6e79b..16a11ed8e1 100644 --- a/Kernel/Bus/PCI/Definitions.h +++ b/Kernel/Bus/PCI/Definitions.h @@ -115,11 +115,11 @@ struct HardwareID { bool is_null() const { return !vendor_id && !device_id; } - bool operator==(const HardwareID& other) const + bool operator==(HardwareID const& other) const { return vendor_id == other.vendor_id && device_id == other.device_id; } - bool operator!=(const HardwareID& other) const + bool operator!=(HardwareID const& other) const { return vendor_id != other.vendor_id || device_id != other.device_id; } @@ -162,24 +162,24 @@ public: { } - Address(const Address& address) = default; + Address(Address const& address) = default; bool is_null() const { return !m_bus && !m_device && !m_function; } operator bool() const { return !is_null(); } // Disable default implementations that would use surprising integer promotion. - bool operator<=(const Address&) const = delete; - bool operator>=(const Address&) const = delete; - bool operator<(const Address&) const = delete; - bool operator>(const Address&) const = delete; + bool operator<=(Address const&) const = delete; + bool operator>=(Address const&) const = delete; + bool operator<(Address const&) const = delete; + bool operator>(Address const&) const = delete; - bool operator==(const Address& other) const + bool operator==(Address const& other) const { if (this == &other) return true; return m_domain == other.m_domain && m_bus == other.m_bus && m_device == other.m_device && m_function == other.m_function; } - bool operator!=(const Address& other) const + bool operator!=(Address const& other) const { return !(*this == other); } @@ -198,7 +198,7 @@ private: class Capability { public: - Capability(const Address& address, u8 id, u8 ptr) + Capability(Address const& address, u8 id, u8 ptr) : m_address(address) , m_id(id) , m_ptr(ptr) @@ -246,7 +246,7 @@ public: , m_capabilities(capabilities) { if constexpr (PCI_DEBUG) { - for (const auto& capability : capabilities) + for (auto const& capability : capabilities) dbgln("{} has capability {}", address, capability.id()); } } diff --git a/Kernel/Bus/PCI/SysFSPCI.cpp b/Kernel/Bus/PCI/SysFSPCI.cpp index 7fe347ef0b..069ae33804 100644 --- a/Kernel/Bus/PCI/SysFSPCI.cpp +++ b/Kernel/Bus/PCI/SysFSPCI.cpp @@ -12,14 +12,14 @@ namespace Kernel::PCI { -UNMAP_AFTER_INIT NonnullRefPtr<PCIDeviceSysFSDirectory> PCIDeviceSysFSDirectory::create(const SysFSDirectory& parent_directory, Address address) +UNMAP_AFTER_INIT NonnullRefPtr<PCIDeviceSysFSDirectory> PCIDeviceSysFSDirectory::create(SysFSDirectory const& parent_directory, Address address) { // FIXME: Handle allocation failure gracefully auto device_name = MUST(KString::formatted("{:04x}:{:02x}:{:02x}.{}", address.domain(), address.bus(), address.device(), address.function())); return adopt_ref(*new (nothrow) PCIDeviceSysFSDirectory(move(device_name), parent_directory, address)); } -UNMAP_AFTER_INIT PCIDeviceSysFSDirectory::PCIDeviceSysFSDirectory(NonnullOwnPtr<KString> device_directory_name, const SysFSDirectory& parent_directory, Address address) +UNMAP_AFTER_INIT PCIDeviceSysFSDirectory::PCIDeviceSysFSDirectory(NonnullOwnPtr<KString> device_directory_name, SysFSDirectory const& parent_directory, Address address) : SysFSDirectory(parent_directory) , m_address(address) , m_device_directory_name(move(device_directory_name)) @@ -92,12 +92,12 @@ StringView PCIDeviceAttributeSysFSComponent::name() const } } -NonnullRefPtr<PCIDeviceAttributeSysFSComponent> PCIDeviceAttributeSysFSComponent::create(const PCIDeviceSysFSDirectory& device, PCI::RegisterOffset offset, size_t field_bytes_width) +NonnullRefPtr<PCIDeviceAttributeSysFSComponent> PCIDeviceAttributeSysFSComponent::create(PCIDeviceSysFSDirectory const& device, PCI::RegisterOffset offset, size_t field_bytes_width) { return adopt_ref(*new (nothrow) PCIDeviceAttributeSysFSComponent(device, offset, field_bytes_width)); } -PCIDeviceAttributeSysFSComponent::PCIDeviceAttributeSysFSComponent(const PCIDeviceSysFSDirectory& device, PCI::RegisterOffset offset, size_t field_bytes_width) +PCIDeviceAttributeSysFSComponent::PCIDeviceAttributeSysFSComponent(PCIDeviceSysFSDirectory const& device, PCI::RegisterOffset offset, size_t field_bytes_width) : SysFSComponent() , m_device(device) , m_offset(offset) diff --git a/Kernel/Bus/PCI/SysFSPCI.h b/Kernel/Bus/PCI/SysFSPCI.h index 4f549c45c3..80c09e46e5 100644 --- a/Kernel/Bus/PCI/SysFSPCI.h +++ b/Kernel/Bus/PCI/SysFSPCI.h @@ -23,13 +23,13 @@ private: class PCIDeviceSysFSDirectory final : public SysFSDirectory { public: - static NonnullRefPtr<PCIDeviceSysFSDirectory> create(const SysFSDirectory&, Address); - const Address& address() const { return m_address; } + static NonnullRefPtr<PCIDeviceSysFSDirectory> create(SysFSDirectory const&, Address); + Address const& address() const { return m_address; } virtual StringView name() const override { return m_device_directory_name->view(); } private: - PCIDeviceSysFSDirectory(NonnullOwnPtr<KString> device_directory_name, const SysFSDirectory&, Address); + PCIDeviceSysFSDirectory(NonnullOwnPtr<KString> device_directory_name, SysFSDirectory const&, Address); Address m_address; @@ -38,7 +38,7 @@ private: class PCIDeviceAttributeSysFSComponent : public SysFSComponent { public: - static NonnullRefPtr<PCIDeviceAttributeSysFSComponent> create(const PCIDeviceSysFSDirectory& device, PCI::RegisterOffset offset, size_t field_bytes_width); + static NonnullRefPtr<PCIDeviceAttributeSysFSComponent> create(PCIDeviceSysFSDirectory const& device, PCI::RegisterOffset offset, size_t field_bytes_width); virtual ErrorOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override; virtual ~PCIDeviceAttributeSysFSComponent() {}; @@ -47,7 +47,7 @@ public: protected: ErrorOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const; - PCIDeviceAttributeSysFSComponent(const PCIDeviceSysFSDirectory& device, PCI::RegisterOffset offset, size_t field_bytes_width); + PCIDeviceAttributeSysFSComponent(PCIDeviceSysFSDirectory const& device, PCI::RegisterOffset offset, size_t field_bytes_width); NonnullRefPtr<PCIDeviceSysFSDirectory> m_device; PCI::RegisterOffset m_offset; size_t m_field_bytes_width; diff --git a/Kernel/Bus/USB/UHCI/UHCIController.cpp b/Kernel/Bus/USB/UHCI/UHCIController.cpp index f478cd6622..488e3b59c4 100644 --- a/Kernel/Bus/USB/UHCI/UHCIController.cpp +++ b/Kernel/Bus/USB/UHCI/UHCIController.cpp @@ -476,7 +476,7 @@ ErrorOr<void> UHCIController::spawn_port_process() return {}; } -bool UHCIController::handle_irq(const RegisterState&) +bool UHCIController::handle_irq(RegisterState const&) { u32 status = read_usbsts(); diff --git a/Kernel/Bus/USB/UHCI/UHCIController.h b/Kernel/Bus/USB/UHCI/UHCIController.h index 0cd243cc92..66279b510e 100644 --- a/Kernel/Bus/USB/UHCI/UHCIController.h +++ b/Kernel/Bus/USB/UHCI/UHCIController.h @@ -71,7 +71,7 @@ private: void write_portsc1(u16 value) { m_io_base.offset(0x10).out(value); } void write_portsc2(u16 value) { m_io_base.offset(0x12).out(value); } - virtual bool handle_irq(const RegisterState&) override; + virtual bool handle_irq(RegisterState const&) override; ErrorOr<void> create_structures(); void setup_schedule(); diff --git a/Kernel/Bus/USB/UHCI/UHCIDescriptorTypes.h b/Kernel/Bus/USB/UHCI/UHCIDescriptorTypes.h index 3f95302b11..8cae746922 100644 --- a/Kernel/Bus/USB/UHCI/UHCIDescriptorTypes.h +++ b/Kernel/Bus/USB/UHCI/UHCIDescriptorTypes.h @@ -185,11 +185,11 @@ struct alignas(16) TransferDescriptor final { // FIXME: For the love of God, use AK SMART POINTERS PLEASE!! TransferDescriptor* next_td() { return m_next_td; } - const TransferDescriptor* next_td() const { return m_next_td; } + TransferDescriptor const* next_td() const { return m_next_td; } void set_next_td(TransferDescriptor* td) { m_next_td = td; } TransferDescriptor* prev_td() { return m_prev_td; } - const TransferDescriptor* prev_td() const { return m_prev_td; } + TransferDescriptor const* prev_td() const { return m_prev_td; } void set_previous_td(TransferDescriptor* td) { m_prev_td = td; } void insert_next_transfer_descriptor(TransferDescriptor* td) @@ -274,11 +274,11 @@ struct alignas(16) QueueHead { // FIXME: For the love of God, use AK SMART POINTERS PLEASE!! QueueHead* next_qh() { return m_next_qh; } - const QueueHead* next_qh() const { return m_next_qh; } + QueueHead const* next_qh() const { return m_next_qh; } void set_next_qh(QueueHead* qh) { m_next_qh = qh; } QueueHead* prev_qh() { return m_prev_qh; } - const QueueHead* prev_qh() const { return m_prev_qh; } + QueueHead const* prev_qh() const { return m_prev_qh; } void set_previous_qh(QueueHead* qh) { m_prev_qh = qh; diff --git a/Kernel/Bus/USB/USBDevice.h b/Kernel/Bus/USB/USBDevice.h index 37336461a8..2ac68482ba 100644 --- a/Kernel/Bus/USB/USBDevice.h +++ b/Kernel/Bus/USB/USBDevice.h @@ -39,7 +39,7 @@ public: u8 address() const { return m_address; } - const USBDeviceDescriptor& device_descriptor() const { return m_device_descriptor; } + USBDeviceDescriptor const& device_descriptor() const { return m_device_descriptor; } USBController& controller() { return *m_controller; } USBController const& controller() const { return *m_controller; } diff --git a/Kernel/Bus/USB/USBEndpoint.h b/Kernel/Bus/USB/USBEndpoint.h index a8e7eba762..15329fc391 100644 --- a/Kernel/Bus/USB/USBEndpoint.h +++ b/Kernel/Bus/USB/USBEndpoint.h @@ -42,7 +42,7 @@ public: static constexpr u8 ENDPOINT_ATTRIBUTES_ISO_MODE_SYNC_TYPE = 0x0c; static constexpr u8 ENDPOINT_ATTRIBUTES_ISO_MODE_USAGE_TYPE = 0x30; - const USBEndpointDescriptor& descriptor() const { return m_descriptor; } + USBEndpointDescriptor const& descriptor() const { return m_descriptor; } bool is_control() const { return (m_descriptor.endpoint_attributes_bitmap & ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_MASK) == ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_CONTROL; } bool is_isochronous() const { return (m_descriptor.endpoint_attributes_bitmap & ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_MASK) == ENDPOINT_ATTRIBUTES_TRANSFER_TYPE_ISOCHRONOUS; } diff --git a/Kernel/Bus/USB/USBTransfer.cpp b/Kernel/Bus/USB/USBTransfer.cpp index c01b3904e7..62dc28e116 100644 --- a/Kernel/Bus/USB/USBTransfer.cpp +++ b/Kernel/Bus/USB/USBTransfer.cpp @@ -26,7 +26,7 @@ Transfer::Transfer(Pipe& pipe, u16 len, NonnullOwnPtr<Memory::Region> data_buffe Transfer::~Transfer() = default; -void Transfer::set_setup_packet(const USBRequestData& request) +void Transfer::set_setup_packet(USBRequestData const& request) { // Kind of a nasty hack... Because the kernel isn't in the business // of handing out physical pointers that we can directly write to, diff --git a/Kernel/Bus/USB/USBTransfer.h b/Kernel/Bus/USB/USBTransfer.h index f4c6570a85..78487da9fc 100644 --- a/Kernel/Bus/USB/USBTransfer.h +++ b/Kernel/Bus/USB/USBTransfer.h @@ -24,13 +24,13 @@ public: Transfer() = delete; ~Transfer(); - void set_setup_packet(const USBRequestData& request); + void set_setup_packet(USBRequestData const& request); void set_complete() { m_complete = true; } void set_error_occurred() { m_error_occurred = true; } // `const` here makes sure we don't blow up by writing to a physical address - const USBRequestData& request() const { return m_request; } - const Pipe& pipe() const { return m_pipe; } + USBRequestData const& request() const { return m_request; } + Pipe const& pipe() const { return m_pipe; } Pipe& pipe() { return m_pipe; } VirtualAddress buffer() const { return m_data_buffer->vaddr(); } PhysicalAddress buffer_physical() const { return m_data_buffer->physical_page(0)->paddr(); } diff --git a/Kernel/Bus/VirtIO/ConsolePort.cpp b/Kernel/Bus/VirtIO/ConsolePort.cpp index b13729d8ec..1908f117af 100644 --- a/Kernel/Bus/VirtIO/ConsolePort.cpp +++ b/Kernel/Bus/VirtIO/ConsolePort.cpp @@ -92,7 +92,7 @@ void ConsolePort::handle_queue_update(Badge<VirtIO::Console>, u16 queue_index) } } -bool ConsolePort::can_read(const OpenFileDescription&, u64) const +bool ConsolePort::can_read(OpenFileDescription const&, u64) const { return m_receive_buffer->used_bytes() > 0; } @@ -122,12 +122,12 @@ ErrorOr<size_t> ConsolePort::read(OpenFileDescription& desc, u64, UserOrKernelBu return bytes_copied; } -bool ConsolePort::can_write(const OpenFileDescription&, u64) const +bool ConsolePort::can_write(OpenFileDescription const&, u64) const { return m_console.get_queue(m_transmit_queue).has_free_slots() && m_transmit_buffer->has_space(); } -ErrorOr<size_t> ConsolePort::write(OpenFileDescription& desc, u64, const UserOrKernelBuffer& data, size_t size) +ErrorOr<size_t> ConsolePort::write(OpenFileDescription& desc, u64, UserOrKernelBuffer const& data, size_t size) { if (!size) return 0; diff --git a/Kernel/Bus/VirtIO/ConsolePort.h b/Kernel/Bus/VirtIO/ConsolePort.h index beed06e1a2..f5c9088ced 100644 --- a/Kernel/Bus/VirtIO/ConsolePort.h +++ b/Kernel/Bus/VirtIO/ConsolePort.h @@ -40,10 +40,10 @@ private: virtual StringView class_name() const override { return "VirtIOConsolePort"sv; } - virtual bool can_read(const OpenFileDescription&, u64) const override; + virtual bool can_read(OpenFileDescription const&, u64) const override; virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override; - virtual bool can_write(const OpenFileDescription&, u64) const override; - virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override; + virtual bool can_write(OpenFileDescription const&, u64) const override; + virtual ErrorOr<size_t> write(OpenFileDescription&, u64, UserOrKernelBuffer const&, size_t) override; virtual ErrorOr<NonnullRefPtr<OpenFileDescription>> open(int options) override; static unsigned next_device_id; diff --git a/Kernel/Bus/VirtIO/Device.cpp b/Kernel/Bus/VirtIO/Device.cpp index 06f5850bcd..9296dc4213 100644 --- a/Kernel/Bus/VirtIO/Device.cpp +++ b/Kernel/Bus/VirtIO/Device.cpp @@ -179,37 +179,37 @@ void Device::notify_queue(u16 queue_index) config_write16(*m_notify_cfg, get_queue(queue_index).notify_offset() * m_notify_multiplier, queue_index); } -u8 Device::config_read8(const Configuration& config, u32 offset) +u8 Device::config_read8(Configuration const& config, u32 offset) { return mapping_for_bar(config.bar).read<u8>(config.offset + offset); } -u16 Device::config_read16(const Configuration& config, u32 offset) +u16 Device::config_read16(Configuration const& config, u32 offset) { return mapping_for_bar(config.bar).read<u16>(config.offset + offset); } -u32 Device::config_read32(const Configuration& config, u32 offset) +u32 Device::config_read32(Configuration const& config, u32 offset) { return mapping_for_bar(config.bar).read<u32>(config.offset + offset); } -void Device::config_write8(const Configuration& config, u32 offset, u8 value) +void Device::config_write8(Configuration const& config, u32 offset, u8 value) { mapping_for_bar(config.bar).write(config.offset + offset, value); } -void Device::config_write16(const Configuration& config, u32 offset, u16 value) +void Device::config_write16(Configuration const& config, u32 offset, u16 value) { mapping_for_bar(config.bar).write(config.offset + offset, value); } -void Device::config_write32(const Configuration& config, u32 offset, u32 value) +void Device::config_write32(Configuration const& config, u32 offset, u32 value) { mapping_for_bar(config.bar).write(config.offset + offset, value); } -void Device::config_write64(const Configuration& config, u32 offset, u64 value) +void Device::config_write64(Configuration const& config, u32 offset, u64 value) { mapping_for_bar(config.bar).write(config.offset + offset, value); } @@ -403,7 +403,7 @@ u8 Device::isr_status() return config_read8(*m_isr_cfg, 0); } -bool Device::handle_irq(const RegisterState&) +bool Device::handle_irq(RegisterState const&) { u8 isr_type = isr_status(); if ((isr_type & (QUEUE_INTERRUPT | DEVICE_CONFIG_INTERRUPT)) == 0) { diff --git a/Kernel/Bus/VirtIO/Device.h b/Kernel/Bus/VirtIO/Device.h index e42be0bb97..3c8fe360bc 100644 --- a/Kernel/Bus/VirtIO/Device.h +++ b/Kernel/Bus/VirtIO/Device.h @@ -119,7 +119,7 @@ protected: } }; - const Configuration* get_config(ConfigurationType cfg_type, u32 index = 0) const + Configuration const* get_config(ConfigurationType cfg_type, u32 index = 0) const { for (auto const& cfg : m_configs) { if (cfg.cfg_type != cfg_type) @@ -148,13 +148,13 @@ protected: } } - u8 config_read8(const Configuration&, u32); - u16 config_read16(const Configuration&, u32); - u32 config_read32(const Configuration&, u32); - void config_write8(const Configuration&, u32, u8); - void config_write16(const Configuration&, u32, u16); - void config_write32(const Configuration&, u32, u32); - void config_write64(const Configuration&, u32, u64); + u8 config_read8(Configuration const&, u32); + u16 config_read16(Configuration const&, u32); + u32 config_read32(Configuration const&, u32); + void config_write8(Configuration const&, u32, u8); + void config_write16(Configuration const&, u32, u16); + void config_write32(Configuration const&, u32, u32); + void config_write64(Configuration const&, u32, u64); auto mapping_for_bar(u8) -> MappedMMIO&; @@ -171,7 +171,7 @@ protected: return m_queues[queue_index]; } - const Queue& get_queue(u16 queue_index) const + Queue const& get_queue(u16 queue_index) const { VERIFY(queue_index < m_queue_count); return m_queues[queue_index]; @@ -224,13 +224,13 @@ private: void reset_device(); u8 isr_status(); - virtual bool handle_irq(const RegisterState&) override; + virtual bool handle_irq(RegisterState const&) override; NonnullOwnPtrVector<Queue> m_queues; Vector<Configuration> m_configs; - const Configuration* m_common_cfg { nullptr }; // Cached due to high usage - const Configuration* m_notify_cfg { nullptr }; // Cached due to high usage - const Configuration* m_isr_cfg { nullptr }; // Cached due to high usage + Configuration const* m_common_cfg { nullptr }; // Cached due to high usage + Configuration const* m_notify_cfg { nullptr }; // Cached due to high usage + Configuration const* m_isr_cfg { nullptr }; // Cached due to high usage IOAddress m_io_base; MappedMMIO m_mmio[6]; diff --git a/Kernel/Bus/VirtIO/Queue.cpp b/Kernel/Bus/VirtIO/Queue.cpp index cb31571e4a..9f18278906 100644 --- a/Kernel/Bus/VirtIO/Queue.cpp +++ b/Kernel/Bus/VirtIO/Queue.cpp @@ -60,8 +60,8 @@ void Queue::disable_interrupts() bool Queue::new_data_available() const { - const auto index = AK::atomic_load(&m_device->index, AK::MemoryOrder::memory_order_relaxed); - const auto used_tail = AK::atomic_load(&m_used_tail, AK::MemoryOrder::memory_order_relaxed); + auto const index = AK::atomic_load(&m_device->index, AK::MemoryOrder::memory_order_relaxed); + auto const used_tail = AK::atomic_load(&m_used_tail, AK::MemoryOrder::memory_order_relaxed); return index != used_tail; } @@ -112,7 +112,7 @@ void Queue::reclaim_buffer_chain(u16 chain_start_index, u16 chain_end_index, siz bool Queue::has_free_slots() const { - const auto free_buffers = AK::atomic_load(&m_free_buffers, AK::MemoryOrder::memory_order_relaxed); + auto const free_buffers = AK::atomic_load(&m_free_buffers, AK::MemoryOrder::memory_order_relaxed); return free_buffers > 0; } diff --git a/Kernel/Bus/VirtIO/Queue.h b/Kernel/Bus/VirtIO/Queue.h index fab091b700..12a5940e15 100644 --- a/Kernel/Bus/VirtIO/Queue.h +++ b/Kernel/Bus/VirtIO/Queue.h @@ -56,7 +56,7 @@ private: void reclaim_buffer_chain(u16 chain_start_index, u16 chain_end_index, size_t length_of_chain); - PhysicalAddress to_physical(const void* ptr) const + PhysicalAddress to_physical(void const* ptr) const { auto offset = FlatPtr(ptr) - m_queue_region->vaddr().get(); return m_queue_region->physical_page(0)->paddr().offset(offset); |