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.
This commit is contained in:
Lenny Maiorani 2022-02-09 11:33:39 -07:00 committed by Linus Groh
parent 6a4c8a66ae
commit c6acf64558
Notes: sideshowbarker 2024-07-17 19:05:21 +09:00
11 changed files with 26 additions and 15 deletions

View file

@ -1,6 +1,7 @@
/*
* Copyright (c) 2020-2021, Liav A. <liavalb@hotmail.co.il>
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -395,7 +396,7 @@ static bool validate_table(const Structures::SDTHeader& v_header, size_t length)
// https://uefi.org/specs/ACPI/6.4/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#finding-the-rsdp-on-ia-pc-systems
UNMAP_AFTER_INIT Optional<PhysicalAddress> StaticParsing::find_rsdp()
{
static constexpr auto signature = "RSD PTR "sv;
constexpr auto signature = "RSD PTR "sv;
auto ebda_or_error = map_ebda();
if (!ebda_or_error.is_error()) {
auto rsdp = ebda_or_error.value().find_chunk_starting_with(signature, 16);