mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
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:
parent
5f1c98e576
commit
3a945051fc
Notes:
sideshowbarker
2024-07-18 03:09:36 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/3a945051fc7 Pull-request: https://github.com/SerenityOS/serenity/pull/10325 Reviewed-by: https://github.com/BenWiederhake
10 changed files with 11 additions and 11 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue