summaryrefslogtreecommitdiff
path: root/Kernel/Devices
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-10-02 15:24:00 -0700
committerAndreas Kling <kling@serenityos.org>2021-10-03 13:36:10 +0200
commit5f1c98e5764c00b4601c959013291c8804e35618 (patch)
treecf0ffd7806a9f5e779db322758d6e2495e55a534 /Kernel/Devices
parent836c22ea1370703279791a864645ab2c6aad2dac (diff)
downloadserenity-5f1c98e5764c00b4601c959013291c8804e35618.zip
Kernel: Use `operator ""sv` in all class_name() 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.
Diffstat (limited to 'Kernel/Devices')
-rw-r--r--Kernel/Devices/ConsoleDevice.h2
-rw-r--r--Kernel/Devices/FullDevice.h2
-rw-r--r--Kernel/Devices/HID/KeyboardDevice.h2
-rw-r--r--Kernel/Devices/HID/MouseDevice.h2
-rw-r--r--Kernel/Devices/HID/PS2KeyboardDevice.h2
-rw-r--r--Kernel/Devices/KCOVDevice.h2
-rw-r--r--Kernel/Devices/MemoryDevice.h2
-rw-r--r--Kernel/Devices/NullDevice.h2
-rw-r--r--Kernel/Devices/RandomDevice.h2
-rw-r--r--Kernel/Devices/SB16.h2
-rw-r--r--Kernel/Devices/SerialDevice.h2
-rw-r--r--Kernel/Devices/ZeroDevice.h2
12 files changed, 12 insertions, 12 deletions
diff --git a/Kernel/Devices/ConsoleDevice.h b/Kernel/Devices/ConsoleDevice.h
index 95b5538ec6..ec039a972f 100644
--- a/Kernel/Devices/ConsoleDevice.h
+++ b/Kernel/Devices/ConsoleDevice.h
@@ -26,7 +26,7 @@ public:
virtual bool can_write(const Kernel::OpenFileDescription&, size_t) const override { return true; }
virtual Kernel::KResultOr<size_t> read(OpenFileDescription&, u64, Kernel::UserOrKernelBuffer&, size_t) override;
virtual Kernel::KResultOr<size_t> write(OpenFileDescription&, u64, const Kernel::UserOrKernelBuffer&, size_t) override;
- virtual StringView class_name() const override { return "Console"; }
+ virtual StringView class_name() const override { return "Console"sv; }
void put_char(char);
diff --git a/Kernel/Devices/FullDevice.h b/Kernel/Devices/FullDevice.h
index 2336e48cff..fc7e9926ec 100644
--- a/Kernel/Devices/FullDevice.h
+++ b/Kernel/Devices/FullDevice.h
@@ -26,7 +26,7 @@ private:
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
virtual bool can_read(const OpenFileDescription&, size_t) const override;
virtual bool can_write(const OpenFileDescription&, size_t) const override { return true; }
- virtual StringView class_name() const override { return "FullDevice"; }
+ virtual StringView class_name() const override { return "FullDevice"sv; }
};
}
diff --git a/Kernel/Devices/HID/KeyboardDevice.h b/Kernel/Devices/HID/KeyboardDevice.h
index b6f80ddf4b..60c10c25fe 100644
--- a/Kernel/Devices/HID/KeyboardDevice.h
+++ b/Kernel/Devices/HID/KeyboardDevice.h
@@ -49,7 +49,7 @@ protected:
mutable Spinlock m_queue_lock;
CircularQueue<Event, 16> m_queue;
// ^CharacterDevice
- virtual StringView class_name() const override { return "KeyboardDevice"; }
+ virtual StringView class_name() const override { return "KeyboardDevice"sv; }
u8 m_modifiers { 0 };
bool m_caps_lock_to_ctrl_pressed { false };
diff --git a/Kernel/Devices/HID/MouseDevice.h b/Kernel/Devices/HID/MouseDevice.h
index 14029050fe..41a939072d 100644
--- a/Kernel/Devices/HID/MouseDevice.h
+++ b/Kernel/Devices/HID/MouseDevice.h
@@ -34,7 +34,7 @@ public:
protected:
MouseDevice();
// ^CharacterDevice
- virtual StringView class_name() const override { return "MouseDevice"; }
+ virtual StringView class_name() const override { return "MouseDevice"sv; }
mutable Spinlock m_queue_lock;
CircularQueue<MousePacket, 100> m_queue;
diff --git a/Kernel/Devices/HID/PS2KeyboardDevice.h b/Kernel/Devices/HID/PS2KeyboardDevice.h
index 39f440a0a9..0fc1c6b440 100644
--- a/Kernel/Devices/HID/PS2KeyboardDevice.h
+++ b/Kernel/Devices/HID/PS2KeyboardDevice.h
@@ -44,7 +44,7 @@ private:
virtual bool handle_irq(const RegisterState&) override;
// ^CharacterDevice
- virtual StringView class_name() const override { return "KeyboardDevice"; }
+ virtual StringView class_name() const override { return "KeyboardDevice"sv; }
};
}
diff --git a/Kernel/Devices/KCOVDevice.h b/Kernel/Devices/KCOVDevice.h
index 576577dff5..7905e4002d 100644
--- a/Kernel/Devices/KCOVDevice.h
+++ b/Kernel/Devices/KCOVDevice.h
@@ -29,7 +29,7 @@ public:
protected:
KCOVDevice();
- virtual StringView class_name() const override { return "KCOVDevice"; }
+ virtual StringView class_name() const override { return "KCOVDevice"sv; }
virtual bool can_read(const OpenFileDescription&, size_t) const override final { return true; }
virtual bool can_write(const OpenFileDescription&, size_t) const override final { return true; }
diff --git a/Kernel/Devices/MemoryDevice.h b/Kernel/Devices/MemoryDevice.h
index 016ab6c556..363a09bd82 100644
--- a/Kernel/Devices/MemoryDevice.h
+++ b/Kernel/Devices/MemoryDevice.h
@@ -26,7 +26,7 @@ public:
private:
MemoryDevice();
- virtual StringView class_name() const override { return "MemoryDevice"; }
+ virtual StringView class_name() const override { return "MemoryDevice"sv; }
virtual bool can_read(const OpenFileDescription&, size_t) const override { return true; }
virtual bool can_write(const OpenFileDescription&, size_t) const override { return false; }
virtual bool is_seekable() const override { return true; }
diff --git a/Kernel/Devices/NullDevice.h b/Kernel/Devices/NullDevice.h
index 7078bac39d..bc638ab4a3 100644
--- a/Kernel/Devices/NullDevice.h
+++ b/Kernel/Devices/NullDevice.h
@@ -26,7 +26,7 @@ private:
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
virtual bool can_write(const OpenFileDescription&, size_t) const override { return true; }
virtual bool can_read(const OpenFileDescription&, size_t) const override;
- virtual StringView class_name() const override { return "NullDevice"; }
+ virtual StringView class_name() const override { return "NullDevice"sv; }
virtual bool is_seekable() const override { return true; }
};
diff --git a/Kernel/Devices/RandomDevice.h b/Kernel/Devices/RandomDevice.h
index 06337479c9..bdb804826b 100644
--- a/Kernel/Devices/RandomDevice.h
+++ b/Kernel/Devices/RandomDevice.h
@@ -26,7 +26,7 @@ private:
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
virtual bool can_read(const OpenFileDescription&, size_t) const override;
virtual bool can_write(const OpenFileDescription&, size_t) const override { return true; }
- virtual StringView class_name() const override { return "RandomDevice"; }
+ virtual StringView class_name() const override { return "RandomDevice"sv; }
};
}
diff --git a/Kernel/Devices/SB16.h b/Kernel/Devices/SB16.h
index 443878eaae..54746d9e1a 100644
--- a/Kernel/Devices/SB16.h
+++ b/Kernel/Devices/SB16.h
@@ -42,7 +42,7 @@ private:
virtual bool handle_irq(const RegisterState&) override;
// ^CharacterDevice
- virtual StringView class_name() const override { return "SB16"; }
+ virtual StringView class_name() const override { return "SB16"sv; }
void initialize();
void wait_for_irq();
diff --git a/Kernel/Devices/SerialDevice.h b/Kernel/Devices/SerialDevice.h
index bc2680a3ec..9768f4c96c 100644
--- a/Kernel/Devices/SerialDevice.h
+++ b/Kernel/Devices/SerialDevice.h
@@ -110,7 +110,7 @@ private:
friend class PCISerialDevice;
// ^CharacterDevice
- virtual StringView class_name() const override { return "SerialDevice"; }
+ virtual StringView class_name() const override { return "SerialDevice"sv; }
void initialize();
void set_interrupts(bool interrupt_enable);
diff --git a/Kernel/Devices/ZeroDevice.h b/Kernel/Devices/ZeroDevice.h
index 63d02f1500..33161b326f 100644
--- a/Kernel/Devices/ZeroDevice.h
+++ b/Kernel/Devices/ZeroDevice.h
@@ -26,7 +26,7 @@ private:
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
virtual bool can_read(const OpenFileDescription&, size_t) const override;
virtual bool can_write(const OpenFileDescription&, size_t) const override { return true; }
- virtual StringView class_name() const override { return "ZeroDevice"; }
+ virtual StringView class_name() const override { return "ZeroDevice"sv; }
};
}