summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendiadyoin1 <leon2002.la@gmail.com>2021-12-08 13:52:14 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-09 22:53:42 -0800
commit471b38db6827cefaef149ec999a7258d74a1678a (patch)
treedafedb476d317ef462de2a86fc83426948da7c9d
parentb03b7f806a4df8fb549ae3d8b9128510bf215342 (diff)
downloadserenity-471b38db6827cefaef149ec999a7258d74a1678a.zip
Kernel: Some clang-tidy fixes in Bus/USB
-rw-r--r--Kernel/Bus/USB/SysFSUSB.cpp2
-rw-r--r--Kernel/Bus/USB/UHCI/UHCIController.h1
-rw-r--r--Kernel/Bus/USB/UHCI/UHCIDescriptorPool.h2
-rw-r--r--Kernel/Bus/USB/UHCI/UHCIRootHub.cpp6
-rw-r--r--Kernel/Bus/USB/USBDevice.cpp2
-rw-r--r--Kernel/Bus/USB/USBDevice.h1
-rw-r--r--Kernel/Bus/USB/USBPipe.h1
7 files changed, 6 insertions, 9 deletions
diff --git a/Kernel/Bus/USB/SysFSUSB.cpp b/Kernel/Bus/USB/SysFSUSB.cpp
index b0b539c8e2..67c8995744 100644
--- a/Kernel/Bus/USB/SysFSUSB.cpp
+++ b/Kernel/Bus/USB/SysFSUSB.cpp
@@ -99,7 +99,7 @@ ErrorOr<void> SysFSUSBBusDirectory::traverse_as_directory(FileSystemID fsid, Fun
TRY(callback({ ".", { fsid, component_index() }, 0 }));
TRY(callback({ "..", { fsid, m_parent_directory->component_index() }, 0 }));
- for (auto& device_node : m_device_nodes) {
+ for (auto const& device_node : m_device_nodes) {
InodeIdentifier identifier = { fsid, device_node.component_index() };
TRY(callback({ device_node.name(), identifier, 0 }));
}
diff --git a/Kernel/Bus/USB/UHCI/UHCIController.h b/Kernel/Bus/USB/UHCI/UHCIController.h
index 20790479ed..e3007763e6 100644
--- a/Kernel/Bus/USB/UHCI/UHCIController.h
+++ b/Kernel/Bus/USB/UHCI/UHCIController.h
@@ -88,7 +88,6 @@ private:
void reset_port(u8);
-private:
IOAddress m_io_base;
OwnPtr<UHCIRootHub> m_root_hub;
diff --git a/Kernel/Bus/USB/UHCI/UHCIDescriptorPool.h b/Kernel/Bus/USB/UHCI/UHCIDescriptorPool.h
index a4658a88c5..eceb249a39 100644
--- a/Kernel/Bus/USB/UHCI/UHCIDescriptorPool.h
+++ b/Kernel/Bus/USB/UHCI/UHCIDescriptorPool.h
@@ -68,7 +68,7 @@ private:
{
// Go through the number of descriptors to create in the pool, and create a virtual/physical address mapping
for (size_t i = 0; i < PAGE_SIZE / sizeof(T); i++) {
- auto placement_address = reinterpret_cast<void*>(m_pool_region->vaddr().get() + (i * sizeof(T)));
+ auto* placement_address = reinterpret_cast<void*>(m_pool_region->vaddr().get() + (i * sizeof(T)));
auto physical_address = static_cast<u32>(m_pool_region->physical_page(0)->paddr().get() + (i * sizeof(T)));
auto* object = new (placement_address) T(physical_address);
m_free_descriptor_stack.push(object); // Push the descriptor's pointer onto the free list
diff --git a/Kernel/Bus/USB/UHCI/UHCIRootHub.cpp b/Kernel/Bus/USB/UHCI/UHCIRootHub.cpp
index 936d3edbb0..1b1dc1d7b9 100644
--- a/Kernel/Bus/USB/UHCI/UHCIRootHub.cpp
+++ b/Kernel/Bus/USB/UHCI/UHCIRootHub.cpp
@@ -85,11 +85,11 @@ static USBHubDescriptor uhci_root_hub_hub_descriptor = {
ErrorOr<NonnullOwnPtr<UHCIRootHub>> UHCIRootHub::try_create(NonnullRefPtr<UHCIController> uhci_controller)
{
- return adopt_nonnull_own_or_enomem(new (nothrow) UHCIRootHub(uhci_controller));
+ return adopt_nonnull_own_or_enomem(new (nothrow) UHCIRootHub(move(uhci_controller)));
}
UHCIRootHub::UHCIRootHub(NonnullRefPtr<UHCIController> uhci_controller)
- : m_uhci_controller(uhci_controller)
+ : m_uhci_controller(move(uhci_controller))
{
}
@@ -109,7 +109,7 @@ ErrorOr<void> UHCIRootHub::setup(Badge<UHCIController>)
ErrorOr<size_t> UHCIRootHub::handle_control_transfer(Transfer& transfer)
{
- auto& request = transfer.request();
+ auto const& request = transfer.request();
auto* request_data = transfer.buffer().as_ptr() + sizeof(USBRequestData);
if constexpr (UHCI_DEBUG) {
diff --git a/Kernel/Bus/USB/USBDevice.cpp b/Kernel/Bus/USB/USBDevice.cpp
index d2de629f45..99b866d830 100644
--- a/Kernel/Bus/USB/USBDevice.cpp
+++ b/Kernel/Bus/USB/USBDevice.cpp
@@ -37,7 +37,7 @@ Device::Device(NonnullRefPtr<USBController> controller, u8 address, u8 port, Dev
: m_device_port(port)
, m_device_speed(speed)
, m_address(address)
- , m_controller(controller)
+ , m_controller(move(controller))
, m_default_pipe(move(default_pipe))
{
}
diff --git a/Kernel/Bus/USB/USBDevice.h b/Kernel/Bus/USB/USBDevice.h
index 0a255fc0ef..f76d34997f 100644
--- a/Kernel/Bus/USB/USBDevice.h
+++ b/Kernel/Bus/USB/USBDevice.h
@@ -26,7 +26,6 @@ public:
LowSpeed
};
-public:
static ErrorOr<NonnullRefPtr<Device>> try_create(USBController const&, u8, DeviceSpeed);
Device(USBController const&, u8, DeviceSpeed, NonnullOwnPtr<Pipe> default_pipe);
diff --git a/Kernel/Bus/USB/USBPipe.h b/Kernel/Bus/USB/USBPipe.h
index 38ff76283c..3e9db8e272 100644
--- a/Kernel/Bus/USB/USBPipe.h
+++ b/Kernel/Bus/USB/USBPipe.h
@@ -40,7 +40,6 @@ public:
FullSpeed
};
-public:
static ErrorOr<NonnullOwnPtr<Pipe>> try_create_pipe(USBController const& controller, Type type, Direction direction, u8 endpoint_address, u16 max_packet_size, i8 device_address, u8 poll_interval = 0);
Type type() const { return m_type; }