Kernel: Some clang-tidy fixes in Bus/USB

This commit is contained in:
Hendiadyoin1 2021-12-08 13:52:14 +01:00 committed by Brian Gianforcaro
parent b03b7f806a
commit 471b38db68
7 changed files with 6 additions and 9 deletions

View file

@ -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 }));
}

View file

@ -88,7 +88,6 @@ private:
void reset_port(u8);
private:
IOAddress m_io_base;
OwnPtr<UHCIRootHub> m_root_hub;

View file

@ -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

View file

@ -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) {

View file

@ -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))
{
}

View file

@ -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);

View file

@ -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; }