Kernel: Use operator ""sv in all purpose() implementations

Previously there was a mix of returning plain strings and returning
explicit string views using `operator ""sv`. This change switches them
all to standardized on `operator ""sv` as it avoids a call to strlen.
This commit is contained in:
Brian Gianforcaro 2021-10-02 15:30:23 -07:00 committed by Andreas Kling
parent 5f1c98e576
commit 3a945051fc
Notes: sideshowbarker 2024-07-18 03:09:36 +09:00
10 changed files with 11 additions and 11 deletions

View file

@ -36,7 +36,7 @@ public:
static KResultOr<NonnullRefPtr<UHCIController>> try_to_initialize(PCI::DeviceIdentifier const& pci_device_identifier);
virtual ~UHCIController() override;
virtual StringView purpose() const override { return "UHCI"; }
virtual StringView purpose() const override { return "UHCI"sv; }
virtual KResult initialize() override;
virtual KResult reset() override;

View file

@ -48,7 +48,7 @@ public:
static void must_initialize(PhysicalAddress rsdp, PhysicalAddress fadt, u8 irq_number);
virtual StringView purpose() const override { return "ACPI Parser"; }
virtual StringView purpose() const override { return "ACPI Parser"sv; }
virtual bool handle_irq(const RegisterState&) override;
Optional<PhysicalAddress> find_table(const StringView& signature);

View file

@ -79,7 +79,7 @@ public:
virtual bool eoi() override;
virtual HandlerType type() const override { return HandlerType::IRQHandler; }
virtual StringView purpose() const override { return "IPI Handler"; }
virtual StringView purpose() const override { return "IPI Handler"sv; }
virtual StringView controller() const override { return nullptr; }
virtual size_t sharing_devices_count() const override { return 0; }
@ -110,7 +110,7 @@ public:
virtual bool eoi() override;
virtual HandlerType type() const override { return HandlerType::IRQHandler; }
virtual StringView purpose() const override { return "SMP Error Handler"; }
virtual StringView purpose() const override { return "SMP Error Handler"sv; }
virtual StringView controller() const override { return nullptr; }
virtual size_t sharing_devices_count() const override { return 0; }

View file

@ -27,7 +27,7 @@ public:
virtual bool eoi() override;
virtual HandlerType type() const override { return HandlerType::IRQHandler; }
virtual StringView purpose() const override { return "IRQ Handler"; }
virtual StringView purpose() const override { return "IRQ Handler"sv; }
virtual StringView controller() const override { return m_responsible_irq_controller->model(); }
virtual size_t sharing_devices_count() const override { return 0; }

View file

@ -32,7 +32,7 @@ public:
virtual bool is_sharing_with_others() const override { return false; }
virtual HandlerType type() const override { return HandlerType::SharedIRQHandler; }
virtual StringView purpose() const override { return "Shared IRQ Handler"; }
virtual StringView purpose() const override { return "Shared IRQ Handler"sv; }
virtual StringView controller() const override { return m_responsible_irq_controller->model(); }
private:

View file

@ -41,7 +41,7 @@ bool SpuriousInterruptHandler::eoi()
StringView SpuriousInterruptHandler::purpose() const
{
if (!m_real_handler)
return "Spurious Interrupt Handler";
return "Spurious Interrupt Handler"sv;
return m_real_handler->purpose();
}

View file

@ -21,7 +21,7 @@ public:
[[noreturn]] virtual bool eoi() override;
virtual HandlerType type() const override { return HandlerType::UnhandledInterruptHandler; }
virtual StringView purpose() const override { return "Unhandled Interrupt Handler"; }
virtual StringView purpose() const override { return "Unhandled Interrupt Handler"sv; }
virtual StringView controller() const override { VERIFY_NOT_REACHED(); }
virtual size_t sharing_devices_count() const override { return 0; }

View file

@ -36,7 +36,7 @@ public:
virtual ~AHCIPortHandler() override;
RefPtr<StorageDevice> device_at_port(size_t port_index) const;
virtual StringView purpose() const override { return "SATA Port Handler"; }
virtual StringView purpose() const override { return "SATA Port Handler"sv; }
AHCI::HBADefinedCapabilities hba_capabilities() const;
NonnullRefPtr<AHCIController> hba_controller() const { return m_parent_controller; }

View file

@ -99,7 +99,7 @@ public:
RefPtr<StorageDevice> master_device() const;
RefPtr<StorageDevice> slave_device() const;
virtual StringView purpose() const override { return "PATA Channel"; }
virtual StringView purpose() const override { return "PATA Channel"sv; }
virtual bool is_dma_enabled() const { return false; }

View file

@ -70,7 +70,7 @@ public:
virtual StringView purpose() const override
{
if (TimeManagement::the().is_system_timer(*this))
return "System Timer";
return "System Timer"sv;
return model();
}