From b2c0dc44b37516b758c38de04c61ad295ac0dff2 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Tue, 12 Aug 2025 11:25:36 +0100 Subject: [PATCH] x86/current: Annotate get_cpu_info() as attr_const The result of this calculation will always be identical, even across context switch in x86. Tell the compiler. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- xen/arch/x86/include/asm/current.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h index a7c9473428..fd30422707 100644 --- a/xen/arch/x86/include/asm/current.h +++ b/xen/arch/x86/include/asm/current.h @@ -83,7 +83,7 @@ static inline struct cpu_info *get_cpu_info_from_stack(unsigned long sp) return (struct cpu_info *)((sp | (STACK_SIZE - 1)) + 1) - 1; } -static inline struct cpu_info *get_cpu_info(void) +static inline attr_const struct cpu_info *get_cpu_info(void) { #ifdef __clang__ /* Clang complains that sp in the else case is not initialised. */