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 <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2025-08-14 21:49:27 +01:00
1 parent be90b7a77f
commit b2c0dc44b3
1 file changed
+1 -1
+1 -1
View File
@@ -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. */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.