summaryrefslogtreecommitdiff
path: root/Kernel/TTY/TTY.cpp
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@serenityos.org>2022-02-09 11:33:39 -0700
committerLinus Groh <mail@linusgroh.de>2022-02-09 21:04:51 +0000
commitc6acf645589cd96b9e25ab9f9da41ca2ae3721b4 (patch)
treece5da59df32cbb23787d4ea11f9742e695cb73c3 /Kernel/TTY/TTY.cpp
parent6a4c8a66aeba4b6ed0a91f2f0e9b7da42fe2b06f (diff)
downloadserenity-c6acf645589cd96b9e25ab9f9da41ca2ae3721b4.zip
Kernel: Change static constexpr variables to constexpr where possible
Function-local `static constexpr` variables can be `constexpr`. This can reduce memory consumption, binary size, and offer additional compiler optimizations. These changes result in a stripped x86_64 kernel binary size reduction of 592 bytes.
Diffstat (limited to 'Kernel/TTY/TTY.cpp')
-rw-r--r--Kernel/TTY/TTY.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Kernel/TTY/TTY.cpp b/Kernel/TTY/TTY.cpp
index 1703e4b926..1a09cfaa37 100644
--- a/Kernel/TTY/TTY.cpp
+++ b/Kernel/TTY/TTY.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -403,7 +404,7 @@ ErrorOr<void> TTY::set_termios(const termios& t)
StringView name;
};
- static constexpr FlagDescription unimplemented_iflags[] = {
+ constexpr FlagDescription unimplemented_iflags[] = {
{ IGNBRK, "IGNBRK" },
{ BRKINT, "BRKINT" },
{ IGNPAR, "IGNPAR" },
@@ -424,7 +425,7 @@ ErrorOr<void> TTY::set_termios(const termios& t)
}
}
- static constexpr FlagDescription unimplemented_oflags[] = {
+ constexpr FlagDescription unimplemented_oflags[] = {
{ OLCUC, "OLCUC" },
{ ONOCR, "ONOCR" },
{ ONLRET, "ONLRET" },
@@ -443,7 +444,7 @@ ErrorOr<void> TTY::set_termios(const termios& t)
rc = ENOTIMPL;
}
- static constexpr FlagDescription unimplemented_cflags[] = {
+ constexpr FlagDescription unimplemented_cflags[] = {
{ CSTOPB, "CSTOPB" },
{ CREAD, "CREAD" },
{ PARENB, "PARENB" },
@@ -458,7 +459,7 @@ ErrorOr<void> TTY::set_termios(const termios& t)
}
}
- static constexpr FlagDescription unimplemented_lflags[] = {
+ constexpr FlagDescription unimplemented_lflags[] = {
{ TOSTOP, "TOSTOP" },
{ IEXTEN, "IEXTEN" }
};