]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: inline a single-use variable 41174/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 20 Mar 2026 08:50:27 +0000 (09:50 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 20 Mar 2026 14:27:57 +0000 (15:27 +0100)
Also, in general we prefer variables that are always defined over
checking with #ifdef, so #if defined(HAVE_NO_STACK_PROTECTOR_ATTRIBUTE)
is something that we want to avoid.

src/boot/efi-log.h

index 5458f90109a0b6196a6a9c880caea53f4089f711..5dbcb425164ede1ca6d80cc4a428804a725a6385 100644 (file)
@@ -5,15 +5,12 @@
 #include "efi-string.h"
 #include "proto/simple-text-io.h"       /* IWYU pragma: keep */
 
-#if defined __has_attribute
-#  if __has_attribute(no_stack_protector)
-#    define HAVE_NO_STACK_PROTECTOR_ATTRIBUTE
-#  endif
-#endif
-
-#if defined(HAVE_NO_STACK_PROTECTOR_ATTRIBUTE) && \
-    (defined(__SSP__) || defined(__SSP_ALL__) || \
-    defined(__SSP_STRONG__) || defined(__SSP_EXPLICIT__))
+#if defined(__has_attribute) &&                                        \
+        __has_attribute(no_stack_protector) &&                         \
+        (defined(__SSP__) ||                                           \
+         defined(__SSP_ALL__) ||                                       \
+         defined(__SSP_STRONG__) ||                                    \
+         defined(__SSP_EXPLICIT__))
 #  define STACK_PROTECTOR_RANDOM 1
 __attribute__((no_stack_protector, noinline)) void __stack_chk_guard_init(void);
 #else