From c6acf645589cd96b9e25ab9f9da41ca2ae3721b4 Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Wed, 9 Feb 2022 11:33:39 -0700 Subject: 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. --- Kernel/Syscall.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Kernel/Syscall.cpp') diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index 1d93502d19..807908000e 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -196,7 +197,7 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap) asm volatile("" : "=m"(*ptr)); - static constexpr FlatPtr iopl_mask = 3u << 12; + constexpr FlatPtr iopl_mask = 3u << 12; FlatPtr flags = regs.flags(); if ((flags & (iopl_mask)) != 0) { -- cgit v1.2.3