mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Some clang-tidy fixes in Bus/VirtIO
This commit is contained in:
parent
471b38db68
commit
9be409585c
Notes:
sideshowbarker
2024-07-17 23:00:43 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/9be409585ca Pull-request: https://github.com/SerenityOS/serenity/pull/11188
5 changed files with 11 additions and 9 deletions
|
@ -22,7 +22,7 @@ UNMAP_AFTER_INIT NonnullRefPtr<Console> Console::must_create(PCI::DeviceIdentifi
|
|||
UNMAP_AFTER_INIT void Console::initialize()
|
||||
{
|
||||
Device::initialize();
|
||||
if (auto cfg = get_config(ConfigurationType::Device)) {
|
||||
if (auto const* cfg = get_config(ConfigurationType::Device)) {
|
||||
bool success = negotiate_features([&](u64 supported_features) {
|
||||
u64 negotiated = 0;
|
||||
if (is_feature_set(supported_features, VIRTIO_CONSOLE_F_SIZE))
|
||||
|
@ -156,7 +156,8 @@ void Console::process_control_message(ControlMessage message)
|
|||
if (id >= m_ports.size()) {
|
||||
dbgln("Device provided an invalid port number {}. max_nr_ports: {}", id, m_ports.size());
|
||||
return;
|
||||
} else if (!m_ports.at(id).is_null()) {
|
||||
}
|
||||
if (!m_ports.at(id).is_null()) {
|
||||
dbgln("Device tried to add port {} which was already added!", id);
|
||||
return;
|
||||
}
|
||||
|
@ -178,7 +179,8 @@ void Console::process_control_message(ControlMessage message)
|
|||
if (message.id >= m_ports.size()) {
|
||||
dbgln("Device provided an invalid port number {}. max_nr_ports: {}", message.id, m_ports.size());
|
||||
return;
|
||||
} else if (m_ports.at(message.id).is_null()) {
|
||||
}
|
||||
if (m_ports.at(message.id).is_null()) {
|
||||
dbgln("Device tried to open port {} which was not added!", message.id);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ UNMAP_AFTER_INIT void detect()
|
|||
});
|
||||
}
|
||||
|
||||
static StringView const determine_device_class(PCI::DeviceIdentifier const& device_identifier)
|
||||
static StringView determine_device_class(PCI::DeviceIdentifier const& device_identifier)
|
||||
{
|
||||
if (device_identifier.revision_id().value() == 0) {
|
||||
// Note: If the device is a legacy (or transitional) device, therefore,
|
||||
|
|
|
@ -121,7 +121,7 @@ protected:
|
|||
|
||||
const Configuration* get_config(ConfigurationType cfg_type, u32 index = 0) const
|
||||
{
|
||||
for (auto& cfg : m_configs) {
|
||||
for (auto const& cfg : m_configs) {
|
||||
if (cfg.cfg_type != cfg_type)
|
||||
continue;
|
||||
if (index > 0) {
|
||||
|
|
|
@ -118,9 +118,9 @@ Optional<u16> Queue::take_free_slot()
|
|||
m_free_head = m_descriptors[descriptor_index].next;
|
||||
--m_free_buffers;
|
||||
return descriptor_index;
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
bool Queue::should_notify() const
|
||||
|
|
|
@ -116,8 +116,8 @@ public:
|
|||
|
||||
QueueChain(QueueChain&& other)
|
||||
: m_queue(other.m_queue)
|
||||
, m_start_of_chain_index(other.m_start_of_chain_index)
|
||||
, m_end_of_chain_index(other.m_end_of_chain_index)
|
||||
, m_start_of_chain_index(move(other.m_start_of_chain_index))
|
||||
, m_end_of_chain_index(move(other.m_end_of_chain_index))
|
||||
, m_chain_length(other.m_chain_length)
|
||||
, m_chain_has_writable_pages(other.m_chain_has_writable_pages)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue