From 086969277e74d8ba065bf8145d3aeb0dec0bfee5 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Fri, 1 Apr 2022 20:58:27 +0300 Subject: Everywhere: Run clang-format --- .../Bus/PCI/Controller/MemoryBackedHostBridge.cpp | 4 ++-- Kernel/Bus/PCI/Definitions.h | 22 +++++++++++----------- Kernel/Bus/PCI/SysFSPCI.cpp | 8 ++++---- Kernel/Bus/PCI/SysFSPCI.h | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'Kernel/Bus/PCI') 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::create(const SysFSDirectory& parent_directory, Address address) +UNMAP_AFTER_INIT NonnullRefPtr 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 device_directory_name, const SysFSDirectory& parent_directory, Address address) +UNMAP_AFTER_INIT PCIDeviceSysFSDirectory::PCIDeviceSysFSDirectory(NonnullOwnPtr 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::create(const PCIDeviceSysFSDirectory& device, PCI::RegisterOffset offset, size_t field_bytes_width) +NonnullRefPtr 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 create(const SysFSDirectory&, Address); - const Address& address() const { return m_address; } + static NonnullRefPtr 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 device_directory_name, const SysFSDirectory&, Address); + PCIDeviceSysFSDirectory(NonnullOwnPtr device_directory_name, SysFSDirectory const&, Address); Address m_address; @@ -38,7 +38,7 @@ private: class PCIDeviceAttributeSysFSComponent : public SysFSComponent { public: - static NonnullRefPtr create(const PCIDeviceSysFSDirectory& device, PCI::RegisterOffset offset, size_t field_bytes_width); + static NonnullRefPtr create(PCIDeviceSysFSDirectory const& device, PCI::RegisterOffset offset, size_t field_bytes_width); virtual ErrorOr read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override; virtual ~PCIDeviceAttributeSysFSComponent() {}; @@ -47,7 +47,7 @@ public: protected: ErrorOr> 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 m_device; PCI::RegisterOffset m_offset; size_t m_field_bytes_width; -- cgit v1.2.3