mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
be90b7a77f
commit
b2c0dc44b3
1 file changed
+1
-1
@@ -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. */
|
||||
|
||||