With all callers of alloc_direct_apic_vector() now being limited to BSP
setup, it and its helpers (whose other callers have already been init-
only) can become __init. As a result data items can be adjusted, too.

Signed-off-by: Jan Beulich <[email protected]>
---
Question is whether with this the "if (*vector == 0)" in
alloc_direct_apic_vector() is of much use anymore.

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -970,22 +970,22 @@ void pirq_set_affinity(struct domain *d,
 DEFINE_PER_CPU(unsigned int, irq_count);
 static DEFINE_PER_CPU(bool, check_eoi_deferral);
 
-uint8_t alloc_hipriority_vector(void)
+uint8_t __init alloc_hipriority_vector(void)
 {
-    static uint8_t next = FIRST_HIPRIORITY_VECTOR;
+    static uint8_t __initdata next = FIRST_HIPRIORITY_VECTOR;
     BUG_ON(next < FIRST_HIPRIORITY_VECTOR);
     BUG_ON(next > LAST_HIPRIORITY_VECTOR);
     return next++;
 }
 
-static void (*direct_apic_vector[X86_IDT_VECTORS])(void);
-void set_direct_apic_vector(uint8_t vector, void (*handler)(void))
+static void (*__ro_after_init direct_apic_vector[X86_IDT_VECTORS])(void);
+void __init set_direct_apic_vector(uint8_t vector, void (*handler)(void))
 {
     BUG_ON(direct_apic_vector[vector] != NULL);
     direct_apic_vector[vector] = handler;
 }
 
-void alloc_direct_apic_vector(uint8_t *vector, void (*handler)(void))
+void __init alloc_direct_apic_vector(uint8_t *vector, void (*handler)(void))
 {
     static DEFINE_SPINLOCK(lock);
 


Reply via email to