boot: inline a single-use variable

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-03-20 15:27:57 +01:00
parent fabc22f599
commit 7e14d3b979
+6 -9
View 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