@@ -264,12 +264,14 @@ static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
264264static inline void io_apic_eoi (unsigned int apic , unsigned int vector )
265265{
266266 struct io_apic __iomem * io_apic = io_apic_base (apic );
267+
267268 writel (vector , & io_apic -> eoi );
268269}
269270
270271unsigned int native_io_apic_read (unsigned int apic , unsigned int reg )
271272{
272273 struct io_apic __iomem * io_apic = io_apic_base (apic );
274+
273275 writel (reg , & io_apic -> index );
274276 return readl (& io_apic -> data );
275277}
@@ -880,9 +882,9 @@ static bool mp_check_pin_attr(int irq, struct irq_alloc_info *info)
880882static int alloc_irq_from_domain (struct irq_domain * domain , int ioapic , u32 gsi ,
881883 struct irq_alloc_info * info )
882884{
885+ int type = ioapics [ioapic ].irqdomain_cfg .type ;
883886 bool legacy = false;
884887 int irq = -1 ;
885- int type = ioapics [ioapic ].irqdomain_cfg .type ;
886888
887889 switch (type ) {
888890 case IOAPIC_DOMAIN_LEGACY :
@@ -951,11 +953,11 @@ static int alloc_isa_irq_from_domain(struct irq_domain *domain, int irq, int ioa
951953static int mp_map_pin_to_irq (u32 gsi , int idx , int ioapic , int pin ,
952954 unsigned int flags , struct irq_alloc_info * info )
953955{
954- int irq ;
955- bool legacy = false;
956+ struct irq_domain * domain = mp_ioapic_irqdomain (ioapic );
956957 struct irq_alloc_info tmp ;
957958 struct mp_chip_data * data ;
958- struct irq_domain * domain = mp_ioapic_irqdomain (ioapic );
959+ bool legacy = false;
960+ int irq ;
959961
960962 if (!domain )
961963 return - ENOSYS ;
@@ -1269,8 +1271,7 @@ static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
12691271
12701272void __init enable_IO_APIC (void )
12711273{
1272- int i8259_apic , i8259_pin ;
1273- int apic , pin ;
1274+ int i8259_apic , i8259_pin , apic , pin ;
12741275
12751276 if (ioapic_is_disabled )
12761277 nr_ioapics = 0 ;
@@ -1943,9 +1944,9 @@ static void lapic_register_intr(int irq)
19431944 */
19441945static inline void __init unlock_ExtINT_logic (void )
19451946{
1946- int apic , pin , i ;
1947- struct IO_APIC_route_entry entry0 , entry1 ;
19481947 unsigned char save_control , save_freq_select ;
1948+ struct IO_APIC_route_entry entry0 , entry1 ;
1949+ int apic , pin , i ;
19491950 u32 apic_id ;
19501951
19511952 pin = find_isa_irq_pin (8 , mp_INT );
@@ -2211,11 +2212,11 @@ static inline void __init check_timer(void)
22112212
22122213static int mp_irqdomain_create (int ioapic )
22132214{
2214- struct irq_domain * parent ;
2215+ struct mp_ioapic_gsi * gsi_cfg = mp_ioapic_gsi_routing ( ioapic ) ;
22152216 int hwirqs = mp_ioapic_pin_count (ioapic );
22162217 struct ioapic * ip = & ioapics [ioapic ];
22172218 struct ioapic_domain_cfg * cfg = & ip -> irqdomain_cfg ;
2218- struct mp_ioapic_gsi * gsi_cfg = mp_ioapic_gsi_routing ( ioapic ) ;
2219+ struct irq_domain * parent ;
22192220 struct fwnode_handle * fn ;
22202221 struct irq_fwspec fwspec ;
22212222
@@ -2491,8 +2492,8 @@ static struct resource *ioapic_resources;
24912492
24922493static struct resource * __init ioapic_setup_resources (void )
24932494{
2494- unsigned long n ;
24952495 struct resource * res ;
2496+ unsigned long n ;
24962497 char * mem ;
24972498 int i ;
24982499
0 commit comments